mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
properly expose bound accounts
This commit is contained in:
parent
00837612d4
commit
5d5103f33c
1 changed files with 8 additions and 0 deletions
|
@ -392,3 +392,11 @@ async def bridge_bind_delete(mx_id: str, code: str = None, state: str = None):
|
||||||
raise HTTPException(400, "Invalid state")
|
raise HTTPException(400, "Invalid state")
|
||||||
await existing.delete()
|
await existing.delete()
|
||||||
return JSONResponse({"status": "ok"}, 200)
|
return JSONResponse({"status": "ok"}, 200)
|
||||||
|
|
||||||
|
@app.get("/bridge/bind/{mx_id}")
|
||||||
|
async def bridge_bind_fetch(mx_id: str):
|
||||||
|
"""Fetch the discord account associated with a matrix account."""
|
||||||
|
existing: Optional[BridgeBind] = await get_or_none(BridgeBind, matrix_id=mx_id)
|
||||||
|
if not existing:
|
||||||
|
raise HTTPException(404, "Not found")
|
||||||
|
return JSONResponse({"discord": existing.user_id}, 200)
|
||||||
|
|
Loading…
Reference in a new issue