Skip to content

Commit

Permalink
fix: pass jwt lifetime seconds as seconds (#686)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex <[email protected]>
  • Loading branch information
Alex-Izquierdo authored Feb 20, 2024
1 parent 4abb207 commit 084179d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/aap_eda/settings/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,17 @@ def _get_secret_key() -> str:
SESSION_SAVE_EVERY_REQUEST = True

# JWT token lifetime
JWT_ACCESS_TOKEN_LIFETIME_SECONDS = settings.get(
"JWT_ACCESS_TOKEN_LIFETIME_SECONDS", 5
JWT_ACCESS_TOKEN_LIFETIME_MINUTES = settings.get(
"JWT_ACCESS_TOKEN_LIFETIME_MINUTES",
5,
)
JWT_REFRESH_TOKEN_LIFETIME_DAYS = settings.get(
"JWT_REFRESH_TOKEN_LIFETIME_DAYS", 2
"JWT_REFRESH_TOKEN_LIFETIME_DAYS",
2,
)
SIMPLE_JWT = {
"ACCESS_TOKEN_LIFETIME": timedelta(
minutes=JWT_ACCESS_TOKEN_LIFETIME_SECONDS
minutes=JWT_ACCESS_TOKEN_LIFETIME_MINUTES,
),
"REFRESH_TOKEN_LIFETIME": timedelta(days=JWT_REFRESH_TOKEN_LIFETIME_DAYS),
}
Expand Down

0 comments on commit 084179d

Please sign in to comment.