简体   繁体   English

如何使用 flutter 检查用户是否已存在于 firebase 身份验证中?

[英]How do I check if a user is already exist in firebase Authentication using flutter?

I'm trying to make Firebase phone auth.我正在尝试对 Firebase 进行电话验证。 I have a situation when a user enters a phone number, then I user verify phone number then sent code and add this user to Authentication users in Firebase console and he has unique UID.我有一种情况,用户输入电话号码,然后我用户验证电话号码,然后发送代码并将此用户添加到 Firebase 控制台中的身份验证用户,他具有唯一的 UID。 BUT when I removed the app and install it again, then I press again the same phone number and I get again a SMS although this user already exists in the Authentication table in the Firebase console.但是,当我删除该应用程序并再次安装它时,我再次按下相同的电话号码并再次收到一条短信,尽管该用户已经存在于 Firebase 控制台的身份验证表中。

BUT when I removed the app and install it again, then I press again the same phone number and I get again a SMS although this user already exists in the Authentication table in the Firebase console.但是,当我删除该应用程序并再次安装它时,我再次按下相同的电话号码并再次收到一条短信,尽管该用户已经存在于 Firebase 控制台的身份验证表中。

That's the expected behavior since your user already has an account.这是预期的行为,因为您的用户已经有一个帐户。 If you want to check if a user already exists, then you have to save that information either in Firestore or in the Realtime Database , and then simply perform a query to check if a particular phone number already exists.如果您想检查用户是否已存在,则必须将该信息保存在Firestore实时数据库中,然后只需执行查询以检查特定电话号码是否已存在。 Unfortunately, you cannot check that in the Firebase console.遗憾的是,您无法在 Firebase 控制台中进行检查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何检查 email 是否已存在于身份验证 firebase 中 - how I can check if the email is already exist in authentication firebase 如何使用 flutter 检查电话号码是否已在 firebase 身份验证中注册 - How to check if phone number is already registered in firebase authentication using flutter Firebase认证中如何查看用户是否已经注册 - How to check if a user is already registered in Firebase Authentication 如何使用 Firebase 在 Flutter 中进行电话身份验证? - How to do Phone Authentication in Flutter using Firebase? 如何使用 Firebase 身份验证保持用户登录 Flutter web 应用程序 - How to keep a user logged in Flutter web app using Firebase Authentication Firebase 身份验证:如何知道 Google 或 Facebook 提供商的帐户是否已经存在? - Firebase Authentication: How to know if account with Google or Facebook provider already exist? 如何获取我刚刚在 Node.js 上使用 firebase 身份验证创建的用户的令牌 ID? - How do I get the token ID of a user that I just created using firebase authentication on Node js? 如何检测用户是否已登录 Firebase? - How do I detect if a user is already logged in Firebase? Firebase:如何在应用检查中注册我的 Flutter 应用? - Firebase: How do I register my Flutter app in app check? Flutter 检查用户名是否已存在于 Firestore 数据库中 - Flutter check if username already exist in Firestore database
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM