firebase / firebaseui-web

FirebaseUI is an open-source JavaScript library for Web that provides simple, customizable UI bindings on top of Firebase SDKs to eliminate boilerplate code and promote best practices.
https://firebase.google.com/
Apache License 2.0
4.58k stars 1.06k forks source link

Enforce sharing of email address if it is disabled on SignIn with Facebook #528

Open avkonst opened 5 years ago

avkonst commented 5 years ago

Is your feature request related to a problem? Please describe. Sign In with Facebook allows a user to opt-out from sharing an email address. As a result user's info received by the Firebase does not have an email address. Why is it a problem?:

Describe the solution you'd like It would be great to have signin dialog to dispatch the case of missed email address and ask a user to provide it before the flow is completed (similarly to sign in by email, the dialog asks for full user's name after signup)

This is where user can opt-out from sharing the email address: image

bojeil-google commented 5 years ago

Hey @avkonst, just to confirm, you are requesting the option to add an email to an account if the user signs in with an identity provider that didn't return an email for the user. Note, for now, after sign-in completion with FirebaseUI, you can always show a page to ask the user to provide their email if the user doesn't have one. You would just call user.updateEmail(email) after they provide the email.

avkonst commented 5 years ago

Yes, this my current workaround I am thinking to add. I assume the email provided via updateEmail will be saved as not verified. Will existing firebase email verification procedure still work after I invoke updateEmail and trigger verification?

On Wed, 21 Nov 2018, 20:59 bojeil-google <notifications@github.com wrote:

Hey @avkonst https://github.com/avkonst, just to confirm, you are requesting the option to add an email to an account if the user signs in with an identity provider that didn't return an email for the user. Note, for now, after sign-in completion with FirebaseUI, you can always show a page to ask the user to provide their email if the user doesn't have one. You would just call user.updateEmail(email) after they provide the email.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/firebase/firebaseui-web/issues/528#issuecomment-440571055, or mute the thread https://github.com/notifications/unsubscribe-auth/ADyZVfhW_bqoxdhJKaH0Oq8oWqtv7VL0ks5uxQf7gaJpZM4YsaOi .

bojeil-google commented 5 years ago

After you call user.updateEmail, trigger user.sendEmailVerification(). It will send a verification email to the user's email.

jek-bao-choo commented 5 years ago

I agree that this will be an useful feature.

garyforsterio commented 5 years ago

:+1: