From 7815baa948ab77b6142df67fb7baee1a7b304f63 Mon Sep 17 00:00:00 2001 From: nex Date: Mon, 19 Feb 2024 12:09:32 +0000 Subject: [PATCH] redirect to the correct location --- web/server.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/server.py b/web/server.py index a54d80f..e76b939 100644 --- a/web/server.py +++ b/web/server.py @@ -349,7 +349,9 @@ async def bridge_bind_new(mx_id: str): token = secrets.token_urlsafe() app.state.binds[token] = mx_id url = discord.utils.oauth_url( - OAUTH_ID, redirect_uri=OAUTH_REDIRECT_URI, scopes=("identify",) + OAUTH_ID, + redirect_uri=OAUTH_REDIRECT_URI[:-4] + "bridge/bind/callback", + scopes=("identify",) ) + f"&state={token}&prompt=none" return { "status": "pending", @@ -383,7 +385,9 @@ async def bridge_bind_delete(mx_id: str, code: str = None, state: str = None): token = secrets.token_urlsafe() app.state.binds[token] = mx_id url = discord.utils.oauth_url( - OAUTH_ID, redirect_uri=OAUTH_REDIRECT_URI, scopes=("identify",) + OAUTH_ID, + redirect_uri=OAUTH_REDIRECT_URI[:-4] + "bridge/bind/callback", + scopes=("identify",) ) + f"&state={token}&prompt=none" return JSONResponse({"status": "pending", "url": url}) else: