Skip to content

Commit

Permalink
add jwt ttl (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuba authored Dec 6, 2024
1 parent c29d558 commit 8c4ccbd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api/api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ async def login_for_access_token(
detail="Incorrect username or password",
headers={"WWW-Authenticate": "Bearer"},
)
access_token_expires = timedelta(minutes=30)
access_token_expires = timedelta(minutes=settings.jwt_ttl_minutes)
access_token = create_access_token(
data={"sub": user.email}, expires_delta=access_token_expires
)
Expand Down
1 change: 1 addition & 0 deletions api/api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Settings(BaseSettings):
mongo_collection_biaint: str = "bia_integrator"
db_name: str
jwt_secret_key: str
jwt_ttl_minutes: int = 1440
user_create_secret_token: str
fastapi_root_path: str = ""

Expand Down

0 comments on commit 8c4ccbd

Please sign in to comment.