Firebase忘记了密码-如何识别用户是通过电子邮件还是Facebook登录? [英] Firebase forgot password- how to identify whether user signed in with email or facebook?
问题描述
这是我的情况.我正在开发firebase login
iOS应用.为此,我正在使用Email & Password Authentication
和facebook authentication
.假设用户知道他的电子邮件但忘记了密码.我如何识别用户是使用Facebook还是电子邮件登录,以及如何重设密码?我搜索了很多.但是找不到解决方案.谁能帮我.
This is my scenario. I am developing a firebase login
iOS app. For this i am using Email & Password Authentication
and facebook authentication
. Lets assume if user knows his email but forgot the password. How can i identify if the user logged in with facebook or email, and how to reset the password? i searched a lot. But could not find a solution for that. can anyone help me.
推荐答案
您可以使用以下方法查找链接到帐户的提供程序: fetchProvidersForEmail
You can lookup the providers linked to an account using: fetchProvidersForEmail
要重置密码,请使用: sendPasswordResetWithEmail
To reset the password, use: sendPasswordResetWithEmail
还有关于如何发送密码重置并重定向回应用程序的说明: https://firebase.google.com/docs/auth/ios/通过电子邮件传递状态
There are also instructions on how to send the password reset and redirect back to app: https://firebase.google.com/docs/auth/ios/passing-state-in-email-actions
这篇关于Firebase忘记了密码-如何识别用户是通过电子邮件还是Facebook登录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!