From 8b2d74ed3f09e29e357900046e7a5a8891cb6e29 Mon Sep 17 00:00:00 2001 From: Rafi Arrafif Date: Wed, 3 Sep 2025 23:17:24 +0700 Subject: [PATCH] :triangular_flag_on_post: (flags) send callback uri Send the frontend callback URI to the backend as required by the OAuth vendor. The frontend explicitly sends the callback URI for flexibility in the backend system. --- features/oauth-callback/lib/sendCallbackToServer.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/features/oauth-callback/lib/sendCallbackToServer.ts b/features/oauth-callback/lib/sendCallbackToServer.ts index 4a9f206..d2c1b72 100644 --- a/features/oauth-callback/lib/sendCallbackToServer.ts +++ b/features/oauth-callback/lib/sendCallbackToServer.ts @@ -2,8 +2,14 @@ import { api } from "@/shared/api/connector"; export const SendCallbackToServer = async (data: string, provider: string) => { + const backendHandlerUrl = `auth/${provider}/callback/`; + const frontendHandlerUrl = `${process.env + .APP_DOMAIN!}/auth/callback/${provider}`; + try { - const response = await api.get(`auth/${provider}/callback${data}`); + const response = await api.get( + `${backendHandlerUrl}${data}&callbackURI=${frontendHandlerUrl}` + ); const result = await response.json(); return result;