Skip to content

Commit

Permalink
Catch exception when loading user from cookie
Browse files Browse the repository at this point in the history
In case of a bad cookie, a 500 error was thrown.
This stuck the user until the cookie was manually
removed. It happens on password change of the
currently connected user.
  • Loading branch information
pirlgon committed Oct 15, 2024
1 parent c160808 commit d22ebd6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/temboardui/web/flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,10 @@ def load_user_from_tornado_secure_cookie(self):
)
if cookie:
cookie = cookie.decode("utf-8")
return get_role_by_cookie(g.db_session, cookie)
try:
return get_role_by_cookie(g.db_session, cookie)
except Exception as e:
logger.error("Failed to load user from cookie: %s", e)


class InstanceMiddleware:
Expand Down

0 comments on commit d22ebd6

Please sign in to comment.