From 0df6031dfcd266d37c091c9088eb30c6fc8ad64d Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Wed, 18 Sep 2024 12:10:28 +0300 Subject: Add new optional parameter to session object: redirect_url. --- gn2/wqflask/oauth2/session.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gn2/wqflask/oauth2/session.py b/gn2/wqflask/oauth2/session.py index b91534b0..78c766a8 100644 --- a/gn2/wqflask/oauth2/session.py +++ b/gn2/wqflask/oauth2/session.py @@ -24,6 +24,7 @@ class SessionInfo(TypedDict): masquerade: Optional[UserDetails] refreshing_token: bool auth_server_jwks: Optional[dict[str, Any]] + redirect_url: Optional[str] __SESSION_KEY__ = "GN::2::session_info" # Do not use this outside this module!! @@ -118,3 +119,10 @@ def toggle_token_refreshing(): def is_token_refreshing(): """Returns whether the token is being refreshed or not.""" return session_info().get("token_refreshing", False) + +def set_redirect_url(url): + """Save the current endpoint object""" + return save_session_info({ + **session_info(), + "redirect_url": url + }) -- cgit v1.2.3