1234567891011121314151617181920212223242526272829 |
- from pydantic import BaseModel
- from typing import Optional
- import datetime
- SECRET_KEY = "df2f77bd544240801a048bd4293afd8eeb7fff3cb7050e42c791db4b83ebadcd"
- ALGORITHM = "HS256"
- class Token(BaseModel):
- access_token: str
- token_type: str
- class User(BaseModel):
- username: str
- password: str
- changPwdTime: Optional[datetime.datetime] = None
- isAdmin: Optional[bool] = None
- isEnable: Optional[bool] = True
- updateTime: Optional[datetime.datetime] = None
- token: Optional[str] = None
- # AuthJWT setting
- class Settings(BaseModel):
- authjwt_secret_key: str = SECRET_KEY
- authjwt_token_location: set = {"cookies"}
- authjwt_cookie_secure: bool = False
- authjwt_cookie_csrf_protect: bool = True
|