-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat(auth): Access to FIRAuthErrorUserInfoUpdatedCredentialKey with Apple Sign In #4359
feat(auth): Access to FIRAuthErrorUserInfoUpdatedCredentialKey with Apple Sign In #4359
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/invertase/react-native-firebase/ef1go89hy |
Codecov Report
@@ Coverage Diff @@
## master #4359 +/- ##
==========================================
- Coverage 67.12% 66.55% -0.56%
==========================================
Files 114 114
Lines 3819 3820 +1
Branches 278 278
==========================================
- Hits 2563 2542 -21
- Misses 1147 1169 +22
Partials 109 109 |
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.
I have some concerns about the semantics of getCredentialForProvider with this change but in general it looks either very close or maybe correct, thanks!
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.
I love the types change but the tests directory changes should be excluded :-)
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.
a thing of beauty!
This fixes an issue with Apple sign on Android. iOS was fixed with this commit. iOS was fixed with this PR invertase#4359. Note the solution is different. On iOS, it looks like we bubble the auth credentials back to js land and then retry login. Here, we attempt another login on auth collision errors
…pple Sign In (invertase#4359) * Access to FIRAuthErrorUserInfoUpdatedCredentialKey with Apple Sign In * Updates type definition
…nvertase#4487) This fixes an issue with Apple sign on Android. iOS was fixed with this commit. iOS was fixed with this PR invertase#4359. Note the solution is different. On iOS, it looks like we bubble the auth credentials back to js land and then retry login. Here, we attempt another login on auth collision errors
Description
Upgrading an anonymous user requires to link the anonymous account with a credential. This operation can fail, if the credential is already associated with another account. A common case is, that you want to sign in to this account then. For most auth providers the first credential can be reused for the sign in operation. In case of Apple Auth, we receive an updated credential in the error.
This PR passes the updated credential (better said: an identifier for the credential) to React Native.
Related issues
Fixes #3952 on iOS.
Release Summary
Pass updated
authCredential
whenlinkWithCredential()
failed withauth/credential-already-in-use
for Apple AuthChecklist
Android
iOS
e2e
tests added or updated inpackages/\*\*/e2e
jest
tests added or updated inpackages/\*\*/__tests__
Test Plan
🔥