🔒 chore(auth.py): import necessary modules and add password context and OAuth2 password bearer scheme for authentication

🔒 chore(auth.py): add password context using bcrypt scheme and OAuth2 password bearer scheme for authentication
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-08-21 16:34:23 -03:00
commit b309d8be0e

View file

@ -2,6 +2,8 @@ from typing import Optional
import secrets
from pydantic import BaseSettings
from passlib.context import CryptContext
from fastapi.security import OAuth2PasswordBearer
class AuthSettings(BaseSettings):
@ -23,6 +25,9 @@ class AuthSettings(BaseSettings):
FIRST_SUPERUSER: str = "langflow"
FIRST_SUPERUSER_PASSWORD: str = "langflow"
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="login")
class Config:
validate_assignment = True
extra = "ignore"