python - 在 Firebase 身份验证时间段后禁用用户帐户
问题描述
我想设置一个时间段来自动停用用户。示例:7 天后禁用用户 x 或注册用户的方法,默认禁用 true
我目前正在使用 pyrebase 和 pyqt5 以这种方式注册
def register(self, screen):
email = screen.email.text()
password = screen.password.text()
confirmpass = screen.confirmpass.text()
if password == confirmpass:
try:
self.auth.create_user_with_email_and_password(email, password)
self.msg_error_registro(screen, msg="Registration successful", bgcolor="background-color:rgb(85, 255, 127);")
screen.email.setText("")
screen.password.setText("")
screen.confirmpass.setText("")
except requests.exceptions.HTTPError as httpErr:
self.error_message = json.loads(httpErr.args[1])['error']['message']
解决方案
Firebase 身份验证中没有内置任何内容可以在一定时间后自动禁用帐户。我也没有在 Pyrebase 中看到设置用户帐户的禁用标志的调用,尽管通过 Pyrebase 包装的 REST API 当然可以这样做。
您是否考虑过使用 Firebase Admin SDK for Python,它支持禁用帐户和更多操作?
推荐阅读
- arrays - 如何在 Swift 中解析数组 API?
- excel - 检查列中的值是否在 Excel 2016 的不同列中的任何点为 TRUE
- javascript - 当我在另一个组件中时如何更改 CSS 属性?
- ruby-on-rails - Rails活动记录唯一约束与postgres上的字段值
- linux - 将 SQL 结果分配给 shell 变量
- python - 熊猫拆分并扩展两列
- php - 从表php Angularjs中删除选定的行
- ruby-on-rails - 测试 ActiveRecord 时如何解释不明确的列名?
- c# - 使用 WCF 从 WSDL 中删除集合父元素
- python - 使用 lib 时 Docker 映像 python-alpine 失败