From e636860a047a2bd6568c8f352f84ded53c854be7 Mon Sep 17 00:00:00 2001 From: Raymond Jacobson Date: Mon, 13 Jul 2026 15:37:18 -0700 Subject: [PATCH] Use POST for Discord JWT request --- .../common/src/hooks/useGetDiscordOAuthLink.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/common/src/hooks/useGetDiscordOAuthLink.ts b/packages/common/src/hooks/useGetDiscordOAuthLink.ts index 4325e30e318..1d39ecfcc94 100644 --- a/packages/common/src/hooks/useGetDiscordOAuthLink.ts +++ b/packages/common/src/hooks/useGetDiscordOAuthLink.ts @@ -22,12 +22,16 @@ const requestDiscordJWT = async (sdk: AudiusSdkWithServices, env: Env) => { message: data }) const response = await fetch( - `${env.DISCORD_BOT_SERVER}/request_discord_code?signature=${encodeURIComponent(signature)}&message=${encodeURIComponent(data)}`, + `${env.DISCORD_BOT_SERVER}/request_discord_code`, { - method: 'GET', + method: 'POST', headers: { 'Content-Type': 'application/json' - } + }, + body: JSON.stringify({ + message: data, + signature + }) } ) if (!response.ok) { @@ -47,6 +51,8 @@ export const useGetDiscordOAuthLink = (currentCoin?: string) => { jwt: discordJWT.token, currentCoin }) - return `${AUDIUS_DISCORD_OAUTH_LINK}&state=${statePayload}` + return `${AUDIUS_DISCORD_OAUTH_LINK}&state=${encodeURIComponent( + statePayload + )}` }, [audiusSdk, env, currentCoin]) }