mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
Fix invalid scopes being generated
This commit is contained in:
parent
c81a1b7fc4
commit
dfa2d18a63
1 changed files with 3 additions and 3 deletions
|
@ -344,12 +344,12 @@ async def bridge_bind_new(mx_id: str):
|
|||
raise HTTPException(409, "Account already bound")
|
||||
|
||||
if not OAUTH_ENABLED:
|
||||
raise HTTPException(503)
|
||||
raise HTTPException(status.HTTP_503_SERVICE_UNAVAILABLE)
|
||||
|
||||
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, scopes=("identify",)
|
||||
) + f"&state={token}&prompt=none"
|
||||
return {
|
||||
"status": "pending",
|
||||
|
@ -383,7 +383,7 @@ 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, scopes=("identify",)
|
||||
) + f"&state={token}&prompt=none"
|
||||
return JSONResponse({"status": "pending", "url": url})
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue