Skip to content

Commit

Permalink
add SignOut if user canceled account linking (clean provider token)
Browse files Browse the repository at this point in the history
  • Loading branch information
yramanchuk committed Oct 20, 2016
1 parent 9d17f34 commit 7883877
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions FirebaseAuthUI/FIRAuthUIBaseViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ - (void)showSignInAlertWithEmail:(NSString *)email
UIAlertAction *cancelAction =
[UIAlertAction actionWithTitle:[FIRAuthUIStrings cancel]
style:UIAlertActionStyleCancel
handler:nil];
handler:^(UIAlertAction * _Nonnull action) {
[self.authUI signOutWithError:nil];
}];
[alertController addAction:cancelAction];
[self presentViewController:alertController animated:YES completion:nil];
} else {
Expand All @@ -241,7 +243,9 @@ - (void)showSignInAlertWithEmail:(NSString *)email
cancelButtonTitle:[FIRAuthUIStrings cancel]
otherButtonTitles:provider.signInLabel, nil];
FIRAuthUIAlertViewDelegate *delegate =
[[FIRAuthUIAlertViewDelegate alloc] initWithCancelHandler:nil otherHandlers:@[ handler ]];
[[FIRAuthUIAlertViewDelegate alloc] initWithCancelHandler:^{
[self.authUI signOutWithError:nil];
} otherHandlers:@[ handler ]];
alertView.delegate = delegate;
[alertView show];
}
Expand Down

0 comments on commit 7883877

Please sign in to comment.