简体   繁体   English

Django 和 Pyrebase:我如何知道我的 email 是否在 firebase 中得到验证

[英]Django & Pyrebase: How do I know if my email is verified or not in firebase

I am building a web app using Django as the framework and firebase as the database.我正在构建一个 web 应用程序,使用 Django 作为框架,firebase 作为数据库。 I am using the pyrebase API.我正在使用pyrebase API。 The API allows sending the verification email but I didn't find any way to find out if the user has verified their email or not. API 允许发送验证 email 但我没有找到任何方法来确定用户是否验证了他们的 email。 Please help!请帮忙!

According to the documentation, the User object contains an emailVerified property.根据文档, User object 包含emailVerified属性。 check if its True检查它是否为真

You should first sign in with e-mail and password by calling this function auth.sign_in_with_email_and_password(email, password) (given in the pyrebase documentation) and store its detail in user variable.您应该首先通过调用此 function auth.sign_in_with_email_and_password(email, password) (在 pyrebase 文档中给出)使用电子邮件和密码登录,并将其详细信息存储在user变量中。 From user variable extract id token and call auth.get_account_info(user['idToken']) (given in the pyrebase documentation) and store its values in some variable name user_info .user变量中提取 id 令牌并调用auth.get_account_info(user['idToken']) (在 pyrebase 文档中给出)并将其值存储在某个变量名user_info中。 This user_info will have a verified flag which can be use for checking the whether the e-mail is verified or not.user_info将有一个已验证标志,可用于检查电子邮件是否已通过验证。 I hope this solution helps.我希望这个解决方案有所帮助。

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

相关问题 怎么知道注册的email在firebase中是否验证过? - How do I know whether the registered email is verified or not in firebase? 如何使用 Pyrebase 将 displayName 添加到我的用户 - how do I add displayName to my user using Pyrebase 如何知道我服务器上的机器人是否经过验证? - How to know if a bot on my server is verified or not? 如何知道用户是否已在Pyrebase和Flask中登录? - How to know whether user is logged in or not in Pyrebase and Flask? 如何在 Django 中实现经过验证的字段? - How can I implement a verified field in django? 如何在django中将数据从html表单推送到firebase实时数据库(使用pyrebase)? - How to push data from html form to firebase realtime database in django(using pyrebase)? 如何使用pyrebase在python中计算firebase数据库? - How to count firebase database in python using pyrebase? Pyrebase和Firebase数据库规则,Python怎么处理? - Pyrebase and Firebase Database Rules, how to deal with it with Python? 我如何知道Django / Python是否正确发送了电子邮件? - How can I know if a email is sent correctly with Django/Python? 试图将 firebase 连接到我的项目,但在 pyrebase 中安装错误并导入 pyrebase 错误 - Trying to connect firebase to my project but installing error in pyrebase and import pyrebase error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM