move variable

This commit is contained in:
2023-10-13 17:54:46 +02:00
parent 86eb1dd4e5
commit 045f52eeef
2 changed files with 3 additions and 3 deletions

View File

@@ -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
)