mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2025-11-03 05:27:06 +08:00
Create a class helper to let configure the password hasher dynamically
This commit is contained in:
@ -22,13 +22,14 @@ from fastapi_users.manager import (
|
||||
)
|
||||
from fastapi_users.models import BaseOAuthAccount, BaseOAuthAccountMixin
|
||||
from fastapi_users.openapi import OpenAPIResponseType
|
||||
from fastapi_users.password import get_password_hash
|
||||
from fastapi_users.password import PasswordHelper
|
||||
|
||||
guinevere_password_hash = get_password_hash("guinevere")
|
||||
angharad_password_hash = get_password_hash("angharad")
|
||||
viviane_password_hash = get_password_hash("viviane")
|
||||
lancelot_password_hash = get_password_hash("lancelot")
|
||||
excalibur_password_hash = get_password_hash("excalibur")
|
||||
password_helper = PasswordHelper()
|
||||
guinevere_password_hash = password_helper.hash("guinevere")
|
||||
angharad_password_hash = password_helper.hash("angharad")
|
||||
viviane_password_hash = password_helper.hash("viviane")
|
||||
lancelot_password_hash = password_helper.hash("lancelot")
|
||||
excalibur_password_hash = password_helper.hash("excalibur")
|
||||
|
||||
|
||||
class User(models.BaseUser):
|
||||
|
||||
Reference in New Issue
Block a user