From fbc46e0517d55df16c90c6950a9ff22161520efd Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sun, 20 Nov 2022 10:02:28 +0100 Subject: [PATCH] More logging for the admin session --- app/admin.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/admin.py b/app/admin.py index 6b69ea2..df2e595 100644 --- a/app/admin.py +++ b/app/admin.py @@ -61,14 +61,17 @@ async def user_session_or_redirect( ) if not session: + logger.info("No existing admin session") raise _RedirectToLoginPage try: loaded_session = session_serializer.loads(session, max_age=3600 * 24 * 3) except Exception: + logger.exception("Failed to validate admin session") raise _RedirectToLoginPage if not loaded_session.get("is_logged_in"): + logger.info(f"Admin session invalidated: {loaded_session}") raise _RedirectToLoginPage return None