carverauto / flutter

🚨 ChaseApp opensource mobile app - follow live police chases 🚔
https://chaseapp.tv
MIT License
3 stars 0 forks source link

[Bug] Firebase Auth : Weird bug that erases auth providers except(google and apple) under some circumstances when signing in with email link. #176

Open rutvik110 opened 2 years ago

rutvik110 commented 2 years ago

Description : I deleted my old auth account in firebase auth and was testing out some things that I updated in auth flow by signing in as a brand new user. I first signed in through Twitter, got signed in , no problem. But then when I signed in through email link sign in method, my twitter auth provider was erased from the providers that I had signed in with earlier. Same happened if I replace Twitter with Facebook as my first sign in method and then try signing in with email link.

Edge cases :

When it occurs: 1) Happened only when signing in with twitter/facebook as a brand new user and then using email link sign.

When it doesn't occurs: 1) Bug didn't occurs when the first sign in method was either google/apple or google/apple auth providers existed in my used auth providers. 2) If your first sign in method is email.

*Will provide more info once I dig into this a little dipper.

How to reproduce?

Check on either staging/production.

  1. Go to auth console on staging/production? https://console.firebase.google.com/u/0/project/chaseapp-staging/authentication/users
  2. Delete you existing account.
  3. Open the app in the staging/production and then sign in through either Twitter or Facebook as your first sign in method.
  4. Check the auth console and you'll see Twitter/Facebook as auth provider mentioned there.
  5. Log out.
  6. Sign in through email link method.
  7. Check the auth console and you'll see only email as auth provider mentioned there.

On whose side is the issue?(Us or Firebase)

Not clear atm.

How does this bug affects us?

Atm, it won't affect us. As the only thing we get from auth providers for the first time user signs in is the user info and then store it in user doc. Other then that we are not using any information from any auth providers for any features in the app.

mfreeman451 commented 2 years ago

Maybe a firebase auth bug?

rutvik110 commented 2 years ago

Might be possible!