Skip to content

Commit c001eb6

Browse files
committed
ыыы
1 parent c106720 commit c001eb6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

utils/auth.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,8 @@ def login_google():
933933
"state": state,
934934
"redirect_uri": redirect_uri,
935935
}
936+
if mobile_redirect_uri:
937+
fallback_payload["mobile_redirect_uri"] = mobile_redirect_uri
936938
fallback_cookie = _encode_oauth_fallback_state(SECRET_KEY, fallback_payload)
937939
request_host = urlparse(request.host_url).hostname
938940
secure_cookie = not _is_loopback_hostname(request_host)
@@ -980,6 +982,9 @@ def authorize_google():
980982
request_code = request.args.get("code", "")
981983
fallback_state_value = str((fallback_state or {}).get("state", ""))
982984
fallback_redirect_uri = str((fallback_state or {}).get("redirect_uri", ""))
985+
fallback_mobile_redirect_uri = str(
986+
(fallback_state or {}).get("mobile_redirect_uri", "")
987+
)
983988
if (
984989
fallback_state
985990
and request_state
@@ -990,6 +995,8 @@ def authorize_google():
990995
app.logger.warning(
991996
"Fallback state validation succeeded. Exchanging token without session state."
992997
)
998+
if not mobile_redirect_uri and fallback_mobile_redirect_uri:
999+
mobile_redirect_uri = fallback_mobile_redirect_uri
9931000
token = oauth.google.fetch_access_token(
9941001
code=request_code,
9951002
redirect_uri=fallback_redirect_uri or request.base_url,

0 commit comments

Comments
 (0)