Skip to content

Anonymous user upgrade federated #401

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

Merged

Conversation

protocol86
Copy link
Contributor

@protocol86 protocol86 commented Feb 1, 2018

Anonymous user upgrade federated accounts and phone auth.

Swift sample will be updated in a follow up PR.

Addresses #139

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.

Had a question and a nit, otherwise LGTM

Please merge #403 first and check that travis passes.

/** @property autoUpgradeAnonymousUsers
@brief Whether to enable auto upgrading of anonymous accounts, defaults to NO.
*/
@property(nonatomic, assign, getter=isAutoUpgradeAnonymousUsers) BOOL autoUpgradeAnonymousUsers;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: rename this to shouldAutoUpgradeAnonymousUsers (for both getter and setter)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, done.

FIRUser *currentUser = self.authUI.auth.currentUser;
// If the user is anonymous, delete the user to avoid dangling anonymous users.
if (currentUser.isAnonymous) {
[currentUser deleteWithCompletion:^(NSError * _Nullable error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we no longer need to delete anonymous users?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do, I just moved the code to the tableview cell. The reason is that I wanted to use the sign in button to trigger a sign-in when the current user was anonymous. Essentially I am separating anonymous sign in/out with "normal" sign in/out.

@morganchen12
Copy link
Contributor

#403 is now merged, feel free to merge this PR as soon as travis tests pass.

Thanks!

@protocol86 protocol86 force-pushed the anonymous_user_upgrade_federated branch from 0667df0 to ba5e708 Compare February 2, 2018 03:59
@protocol86 protocol86 merged commit 3fa49f5 into anonymous_updgrade_master Feb 2, 2018
protocol86 added a commit that referenced this pull request Jul 17, 2018
* Add anonymous sign in upgrade

* Returns merge error in the correct place.

* Adds comments and minor changes

* Adds correct error handling for linking errors

* Addresses comments

Addresses comments
Minor enhances
Fixes bug where wrong error is returned
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