Skip to content
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

[Auth] nil out SafariViewController when presentation finishes #13715

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

ncooke3
Copy link
Member

@ncooke3 ncooke3 commented Sep 24, 2024

I figured how to easily reproduce #13645:

  1. Launch app on iOS simulator
  2. Navigate to the phone number view controller and enter a phone #, tap Send Verification Code
  3. The reCaptcha flow should start. Dismiss the presented controller by tapping Done in top left or swiping down
  4. An error should be propagated to indicate the user cancelled action. On Firebase 10.29.0, the error will be caught and displayed. On 11.2.0, nothing happens.

This PR fixes the issue and the error propagates.

Compared to v10 implementation, the v11 implementation was missing line 130.

- (void)safariViewControllerDidFinish:(SFSafariViewController *)controller {
dispatch_async(FIRAuthGlobalWorkQueue(), ^() {
if (controller == self->_safariViewController) {
self->_safariViewController = nil;
// TODO:Ensure that the SFSafariViewController is actually removed from the screen before
// invoking finishPresentationWithURL:error:
[self finishPresentationWithURL:nil
error:[FIRAuthErrorUtils webContextCancelledErrorWithMessage:nil]];
}
});
}

Fix #13645

Copy link
Member

@paulb777 paulb777 left a comment

Choose a reason for hiding this comment

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

LGTM! Please add changelog

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants