Access to FIRAuthErrorUserInfoUpdatedCredentialKey on linkUserWithCredential auth/credential-already-in-use error #916
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Type
What kind of change does this PR introduce?
Anonymous account linking operation can fail if the credential is already associated with another account. A common case is, that you want to either link or sign in to an account. 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.
The plugin would not handle that error correctly, so the user would have to go through double sign in popups in order to make that flow work
What is the purpose of this PR?
createAuthErrorResult would not handle the case of FIRAuthErrorCodeCredentialAlreadyInUse as it should- it would not save the updatedCredentials that are returned in the error and it did not pass them forward.
Saved the updatedCredentials and sent it forward.
Does this PR introduce a breaking change?
What testing has been done on the changes in the PR?
Tested on my own private project