FirebaseExtended / firebase-video-samples

This repository contains sample code for some of the videos on the Firebase YouTube channel.
https://www.youtube.com/c/firebase
Apache License 2.0
113 stars 114 forks source link

Sign In With Apple sheet is not dismissed on login with anonymous auth #53

Open Wallman opened 7 months ago

Wallman commented 7 months ago

Applies to the auth-account-linking/final project.

Expected Behavior

When signing in with Apple, the sheet is not dismissed.

Actual Behavior

Sheet stays open.

Steps to Reproduce the Problem

  1. Sign In With Apple

Specifications

iOS 17.2.1 / iPhone 14

Wallman commented 7 months ago

@peterfriese Would love to hear your input on this 🙏

Coding-Solo commented 6 months ago

@Wallman Add this to your SingInWithAppleButton's onCompletion handler

if case .success(_) = result { dismiss() }

So that it looks something like this: (assuming you are using the auth-account-linking/final project without modification)

SignInWithAppleButton(.signIn) { request in
    viewModel.handleSignInWithAppleRequest(request)
  } onCompletion: { result in
    viewModel.handleSignInWithAppleCompletion(result)
      if case .success(_) = result { dismiss() }
  }

I'm making a PR to fix this issue :)