mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
Fix server
This commit is contained in:
parent
5449a7d4ce
commit
09542ab7b3
1 changed files with 8 additions and 8 deletions
|
@ -14,15 +14,14 @@ from discord.ext.commands import Paginator
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
import httpx
|
import httpx
|
||||||
from fastapi import FastAPI, Header, HTTPException, Request, dependencies, status, Depends
|
from fastapi import FastAPI, HTTPException, Request, status, Depends, Query
|
||||||
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials as HTTPAuthCreds
|
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials as HTTPAuthCreds
|
||||||
from fastapi import WebSocketException as _WSException
|
from fastapi import WebSocketException as _WSException
|
||||||
from fastapi.responses import HTMLResponse, JSONResponse, RedirectResponse
|
from fastapi.responses import HTMLResponse, JSONResponse, RedirectResponse
|
||||||
from starlette.websockets import WebSocket, WebSocketDisconnect
|
from starlette.websockets import WebSocket, WebSocketDisconnect
|
||||||
from websockets.exceptions import WebSocketException
|
from websockets.exceptions import WebSocketException
|
||||||
|
|
||||||
from config import guilds
|
from utils import get_or_none, BridgeBind
|
||||||
from utils import BannedStudentID, Student, VerifyCode, console, get_or_none, BridgeBind
|
|
||||||
from utils.db import AccessTokens
|
from utils.db import AccessTokens
|
||||||
|
|
||||||
SF_ROOT = Path(__file__).parent / "static"
|
SF_ROOT = Path(__file__).parent / "static"
|
||||||
|
@ -392,6 +391,7 @@ async def bridge_bind_delete(mx_id: str, code: str = None, state: str = None):
|
||||||
await existing.delete()
|
await existing.delete()
|
||||||
return JSONResponse({"status": "ok"}, 200)
|
return JSONResponse({"status": "ok"}, 200)
|
||||||
|
|
||||||
|
|
||||||
@app.get("/bridge/bind/{mx_id}", dependencies=[Depends(is_authenticated)])
|
@app.get("/bridge/bind/{mx_id}", dependencies=[Depends(is_authenticated)])
|
||||||
async def bridge_bind_fetch(mx_id: str):
|
async def bridge_bind_fetch(mx_id: str):
|
||||||
"""Fetch the discord account associated with a matrix account."""
|
"""Fetch the discord account associated with a matrix account."""
|
||||||
|
|
Loading…
Reference in a new issue