From ed66636c3443784fd14b516fcf6941bf798c6d16 Mon Sep 17 00:00:00 2001 From: Leander Furumo Date: Fri, 23 Oct 2026 02:37:19 +0200 Subject: [PATCH] send verification notification with pg_notify instead of f-string NOTIFY Co-Authored-By: Claude Opus 5.5 --- verification_server/src/server.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/verification_server/src/server.py b/verification_server/src/server.py index b33f632..9ede3d3 100644 --- a/verification_server/src/server.py +++ b/verification_server/src/server.py @@ -124,9 +124,8 @@ async def callback(request: Request, code: str, state: str): ) # Notify bot that user is verified - # asyncpg does not allow for arguments in NOTIFY queries, hence we use f-strings - notify_query = f"NOTIFY galtinn_auth_complete, '{discord_id} {user['sub']}'" - await app.state.pool.execute(notify_query) + # NOTIFY does not accept query arguments, but pg_notify does + await app.state.pool.execute("SELECT pg_notify('galtinn_auth_complete', $1)", f"{discord_id} {user['sub']}") return RedirectResponse(f"/success/{user['preferred_username']}", status_code=303)