Gros refactoring
This commit is contained in:
parent
6008aa68f6
commit
4a6bfc951f
368 changed files with 22503 additions and 3 deletions
24
backend/config.py
Normal file
24
backend/config.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
import os
|
||||
|
||||
from fastapi.security import OAuth2PasswordBearer
|
||||
from passlib.context import CryptContext
|
||||
|
||||
from dotenv import load_dotenv
|
||||
load_dotenv()
|
||||
|
||||
ACCESS_TOKEN_EXPIRE_MINUTES = 60 * 24 * 7 # 7 days
|
||||
SECRET_KEY = os.getenv("SECRET_KEY")
|
||||
USERNAME = os.getenv("USERNAME")
|
||||
PASS_HASH = os.getenv("PASS_HASH")
|
||||
ALGORITHM = os.getenv("ALGORITHM")
|
||||
|
||||
def get_fake_users_db():
|
||||
return {
|
||||
os.getenv("USERNAME"): {
|
||||
"username": os.getenv("USERNAME"),
|
||||
"hashed_password": os.getenv("PASS_HASH"),
|
||||
"disabled": False,
|
||||
}
|
||||
}
|
||||
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
|
||||
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
|
Loading…
Add table
Add a link
Reference in a new issue