firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.46k stars 3.91k forks source link

🐛 [flutter_facebook_auth] Automatically verify email addresses with Facebook sign-in #12769

Closed lukehutch closed 2 weeks ago

lukehutch commented 3 weeks ago

Right now the email address is not trusted in a Facebook sign-in. Refs:

However Flutter Auth has built-in support for email verification. So why not automatically initiate email verification by default for Facebook sign-in, and then mark the email address as trusted once the user has verified they can access that email account?

And actually, rather than throwing the FirebaseAuthException exception with e.code == 'account-exists-with-different-credential' when a user signs in with a trusted email provider and then later signs into Facebook from an account that declares that same email address, why not assume that the email is trusted, as long as the user is signing in from the same device, since the email address was already determined to be verified by the earlier login?

russellwheatley commented 2 weeks ago

Hi @lukehutch - FlutterFire will not be deviating from the native Firebase SDKs as we are a thin wrapper around them. As described here, you can use Firebase admin SDK to make it a verified email.

Here is the documentation for handling account existing with different credential.

lukehutch commented 2 weeks ago

OK, I'll close this then. Thanks.