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: