-
Notifications
You must be signed in to change notification settings - Fork 486
anonymous upgrade for email password accounts #405
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
anonymous upgrade for email password accounts #405
Conversation
morganchen12
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.
LGTM with a few nits.
| return; | ||
| case FIRAuthErrorCodeTooManyRequests: | ||
| [self showAlertWithMessage:FUILocalizedString(kStr_SignInTooManyTimesError)]; | ||
| [FIREmailAuthProvider credentialWithEmail:email password:password]; |
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.
nit: indent
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.
Done.
| NSDictionary *userInfo = @{ FUIAuthCredentialKey : credential }; | ||
| NSError *mergeError = [NSError errorWithDomain:FUIAuthErrorDomain | ||
| code:FUIAuthErrorCodeMergeConflict | ||
| userInfo:userInfo]; |
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.
nit: this could maybe be moved into FUIAuthErrors.m.
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.
Moved to FUIAuthErrorUntils.
| completion:^(FIRAuthDataResult *_Nullable authResult, | ||
| NSError *_Nullable error) { | ||
| completeSignInBlock(authResult, error); | ||
| }]; |
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.
nit: You can just pass the block directly to the method here.
[self.auth signInAndRetrieveDataWithCredential:credential completion:completeSignInBlock];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.
Done :)
* anonymous upgrade for email password accounts * addresses comments
Adds anonymous upgrade support for email/password credentials.