关于login.py设计的疑问 #1597
关于login.py设计的疑问
#1597
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
if not user: logger.info(f"用户不存在,创建用户: {form_data.username}") user = User(name=form_data.username, is_active=True, is_superuser=False, hashed_password=get_password_hash(token)) user.create(db)
上述代码其中辅助认证用户db中存储的是hash token
user = User(name=form_data.username, is_active=True, is_superuser=False, hashed_password=get_password_hash(token))
但普通用户使用的是 hash password,这会导致下次使用辅助认证用户登录时
user = User.authenticate( db=db, name=form_data.username, password=form_data.password )
返None。 这个设计是符合预期的吗?
Beta Was this translation helpful? Give feedback.
All reactions