This commit is contained in:
@@ -493,10 +493,14 @@ async def oauth_callback(request: Any) -> JSONResponse | RedirectResponse:
|
||||
|
||||
# Определяем финальный URL для редиректа
|
||||
if "testing.discours.io" in parsed_redirect.netloc:
|
||||
# Для testing.discours.io только httpOnly cookie, без JWT в URL
|
||||
# 💋 Для testing.discours.io используем httpOnly cookie + токен в URL для фронтенда
|
||||
from urllib.parse import quote
|
||||
|
||||
final_redirect_url = f"https://testing.discours.io/oauth?redirect_url={quote(redirect_uri)}"
|
||||
final_redirect_url = (
|
||||
f"https://testing.discours.io/oauth?access_token={session_token}&redirect_url={quote(redirect_uri)}"
|
||||
)
|
||||
if state:
|
||||
final_redirect_url += f"&state={state}"
|
||||
else:
|
||||
# Для других доменов используем старую логику с токеном в URL
|
||||
from urllib.parse import parse_qs, urlencode, urlunparse
|
||||
@@ -836,10 +840,14 @@ async def oauth_callback_http(request: Request) -> JSONResponse | RedirectRespon
|
||||
|
||||
# Определяем финальный URL для редиректа
|
||||
if "testing.discours.io" in parsed_redirect.netloc:
|
||||
# Для testing.discours.io только httpOnly cookie, без JWT в URL
|
||||
# 💋 Для testing.discours.io используем httpOnly cookie + токен в URL для фронтенда
|
||||
from urllib.parse import quote
|
||||
|
||||
final_redirect_url = f"https://testing.discours.io/oauth?redirect_url={quote(redirect_uri)}"
|
||||
final_redirect_url = (
|
||||
f"https://testing.discours.io/oauth?access_token={session_token}&redirect_url={quote(redirect_uri)}"
|
||||
)
|
||||
if state:
|
||||
final_redirect_url += f"&state={state}"
|
||||
else:
|
||||
# Для других доменов используем старую логику с токеном в URL
|
||||
from urllib.parse import parse_qs, urlencode, urlunparse
|
||||
|
||||
Reference in New Issue
Block a user