From 49070119275b8b1fd9a626834a68a61d69d84f64 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Tue, 27 Aug 2024 13:10:52 +0200 Subject: [PATCH] Ensure OAuth expiry is numeric and can be compared (#7191) --- panel/auth.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/panel/auth.py b/panel/auth.py index a68a50c41a..28c206c11a 100644 --- a/panel/auth.py +++ b/panel/auth.py @@ -1026,6 +1026,12 @@ async def get_user(handler): except Exception: pass + # Try casting expiry to float as it may be stored as bytes + try: + expiry = float(expiry) + except Exception: + expiry = None + if expiry is None: expiry = handler.get_secure_cookie('oauth_expiry', max_age_days=config.oauth_expiry) if expiry is None: