Skip to content

Commit

Permalink
Ensure OAuth expiry is numeric and can be compared (#7191)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Aug 27, 2024
1 parent 1f81c71 commit 4907011
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions panel/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4907011

Please sign in to comment.