From 084179d43447b747ab079dedf9d07f80858d8395 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 20 Feb 2024 15:19:33 +0100 Subject: [PATCH] fix: pass jwt lifetime seconds as seconds (#686) Signed-off-by: Alex --- src/aap_eda/settings/default.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/aap_eda/settings/default.py b/src/aap_eda/settings/default.py index 9bd888c37..dda205061 100644 --- a/src/aap_eda/settings/default.py +++ b/src/aap_eda/settings/default.py @@ -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), }