init
This commit is contained in:
@@ -38,6 +38,7 @@ jinja2
|
|||||||
# JWT认证
|
# JWT认证
|
||||||
python-jose[cryptography]
|
python-jose[cryptography]
|
||||||
passlib[bcrypt]
|
passlib[bcrypt]
|
||||||
|
bcrypt
|
||||||
|
|
||||||
# 邮箱验证
|
# 邮箱验证
|
||||||
email-validator
|
email-validator
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ def verify_password(plain_password: str, hashed_password: str) -> bool:
|
|||||||
|
|
||||||
|
|
||||||
def get_password_hash(password: str) -> str:
|
def get_password_hash(password: str) -> str:
|
||||||
|
if len(password.encode('utf-8')) > 72:
|
||||||
|
password = password[:72]
|
||||||
return pwd_context.hash(password)
|
return pwd_context.hash(password)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user