-
Notifications
You must be signed in to change notification settings - Fork 0
chore: Update to use new signIn function
#6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cbe039b to
d5d3f9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the signIn function to use a new API that simplifies the authentication flow by consolidating permissions into a single array and enriching the response with additional user information.
- Simplified
signInfunction signature from two permission arrays (required/optional) to a single permissions array - Renamed
YouVersionLoginResulttoSignInWithYouVersionResultand made all fields optional - Added new user fields to the sign-in result:
expiryDate,refreshToken,name,profilePicture, andemail
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types.ts | Renamed result type and added optional user fields (expiryDate, refreshToken, name, profilePicture, email) |
| src/native.ts | Updated native module signature to accept single permissions array |
| src/api/users.ts | Simplified API to accept single permissions parameter instead of object with required/optional fields |
| src/tests/RNYouVersionPlatform/native-test.native.ts | Updated test to use new single-array API and use objectContaining matcher |
| mocks/RNYouVersionPlatform.ts | Updated return type name to SignInWithYouVersionResult |
| ios/YVPAuthAPI.swift | Updated Swift implementation to use single permissions set and map new user fields to response |
| ios/RNYouVersionPlatformModule.swift | Updated module function signature to accept single permissions array |
| example/src/screens/ProfileScreen.tsx | Updated example to use new API and improved error handling separation |
| README.md | Updated documentation to reflect new API signature and return fields |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mic-mart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @sidorchukandrew !
Instead of requiredPermissions and optionalPermissions, we will only support a simple array of permissions.
cdbafa6 to
09a61f2
Compare
|
🎉 This PR is included in version 0.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This includes a change to what we pass to the function as well as what gets returned. The 2 permissions arrays is now just 1 array. The returned object also contains extra fields about the user.