FirebaseUI-iOS icon indicating copy to clipboard operation
FirebaseUI-iOS copied to clipboard

Email link re-authentication doesn’t work

Open akifumi opened this issue 5 years ago • 1 comments

Environment

  • Objective C or Swift: Swift
  • iOS version: 12.2
  • Firebase SDK version: 6.4.0
  • FirebaseUI version: 8.0.4
  • CocoaPods Version: 1.7.3

Describe the problem:

Steps to reproduce:

  1. Setup anonymous & email link authentication
  2. Set shouldAutoUpgradeAnonymousUsers to true
  3. Sign in anonymously
  4. Authenticate with email link
  5. Sign out
  6. Sign in anonymously again
  7. Authenticate with email link same as email of step4
  8. Email link authentication does not work

Observed Results:

  • What happened? This could be a description, log output, etc.
  • The error FIRAuthErrorCodeEmailAlreadyInUse is occurred
    • https://github.com/firebase/FirebaseUI-iOS/blob/master/EmailAuth/FirebaseEmailAuthUI/FUIEmailAuth.m#L381-L387
  • However success alert is displayed because completion handler does not handle FIRAuthErrorCodeEmailAlreadyInUse error
    • https://github.com/firebase/FirebaseUI-iOS/blob/master/EmailAuth/FirebaseEmailAuthUI/FUIEmailAuth.m#L355-L374

Expected Results:

  • Sign in with email link succeeds

Relevant Code:

  • https://github.com/firebase/FirebaseUI-iOS/blob/master/EmailAuth/FirebaseEmailAuthUI/FUIEmailAuth.m#L381-L387
  • https://github.com/firebase/FirebaseUI-iOS/blob/master/EmailAuth/FirebaseEmailAuthUI/FUIEmailAuth.m#L355-L374

Thanks

akifumi avatar Jul 19 '19 14:07 akifumi

I have been working on a problem that I believe is exactly this issue. I have a workaround for re-authentication, but it isn't ideal: https://stackoverflow.com/questions/58290744/firebase-ui-email-link-opens-app-and-is-handled-by-the-proper-method-but-does-n/58313033#58313033

I also provide more context on where the issue is occurring which can be summed up as:

Not sure if this is the intended outcome for this scenario, but since this issue is still open I thought I would contribute more information to help pinpoint the issue.

tenmar avatar Oct 09 '19 22:10 tenmar