Skip to content

Conversation

@protocol86
Copy link
Contributor

Adds anonymous upgrade support for email/password credentials.

Copy link
Contributor

@morganchen12 morganchen12 left a 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];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indent

Copy link
Contributor Author

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];
Copy link
Contributor

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.

Copy link
Contributor Author

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);
}];
Copy link
Contributor

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];

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done :)

@protocol86 protocol86 merged commit 81573c7 into anonymous_updgrade_master Feb 9, 2018
protocol86 added a commit that referenced this pull request Jul 17, 2018
* anonymous upgrade for email password accounts

* addresses comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants