diff --git a/app/dependencies/users_active.py b/app/dependencies/users_active.py index 9ca2b78..0078b75 100644 --- a/app/dependencies/users_active.py +++ b/app/dependencies/users_active.py @@ -21,7 +21,7 @@ fake_users = [ SECRET_KEY = "09d25e094faa6ca2556c818166b7a9563b93f7099f6f0f4caa6cf63b88e8d3e7" ALGORITHM = "HS256" -ACCESS_TOKEN_EXPIRE_MINUTES = 30 + pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto") diff --git a/app/routers/token.py b/app/routers/token.py index 4d99f28..8467059 100644 --- a/app/routers/token.py +++ b/app/routers/token.py @@ -7,7 +7,7 @@ from ..dependencies import users_active from ..models import token router = APIRouter() - +ACCESS_TOKEN_EXPIRE_MINUTES = 30 @router.post("/token", response_model=token.Token, tags=["token"]) async def login_for_access_token( @@ -20,7 +20,7 @@ async def login_for_access_token( detail="Incorrect username or password", headers={"WWW-Authenticate": "Bearer"}, ) - access_token_expires = timedelta(minutes=users_active.ACCESS_TOKEN_EXPIRE_MINUTES) + access_token_expires = timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES) access_token = users_active.create_access_token( data={"sub": user.username}, expires_delta=access_token_expires )