aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/session.py
diff options
context:
space:
mode:
Diffstat (limited to 'gn_auth/session.py')
-rw-r--r--gn_auth/session.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gn_auth/session.py b/gn_auth/session.py
index 7226ac5..39f6959 100644
--- a/gn_auth/session.py
+++ b/gn_auth/session.py
@@ -47,11 +47,11 @@ def session_expired() -> bool:
return now >= session[__SESSION_KEY__]["expires"]
return True
-def update_expiry() -> bool:
+def update_expiry(minutes: int = 10) -> bool:
"""Update the session expiry and return a boolean indicating success."""
if not session_expired():
now = datetime.now(tz=timezone.utc)
- session[__SESSION_KEY__]["expires"] = now + timedelta(minutes=10)
+ session[__SESSION_KEY__]["expires"] = now + timedelta(minutes=minutes)
return True
return False