aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/oauth2
diff options
context:
space:
mode:
authorAlexander_Kabui2024-09-18 12:10:28 +0300
committerAlexander_Kabui2024-09-18 12:10:28 +0300
commit0df6031dfcd266d37c091c9088eb30c6fc8ad64d (patch)
treed8fae3d44eefa37619a76ea979917636998e9d0e /gn2/wqflask/oauth2
parente2bcefce9a3f77a86542cb41d53a82ce2dcdc2ad (diff)
downloadgenenetwork2-0df6031dfcd266d37c091c9088eb30c6fc8ad64d.tar.gz
Add new optional parameter to session object: redirect_url.
Diffstat (limited to 'gn2/wqflask/oauth2')
-rw-r--r--gn2/wqflask/oauth2/session.py8
1 files changed, 8 insertions, 0 deletions
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
+ })