From 86f8c2a96dc38b340ff48d003210b45aed9a86f1 Mon Sep 17 00:00:00 2001 From: Rafi Arrafif Date: Wed, 3 Sep 2025 15:34:11 +0700 Subject: [PATCH] :construction: (wip) try to add callback uri option --- src/modules/auth/controllers/googleCallback.controller.ts | 2 +- src/modules/auth/services/http/googleCallback.service.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/auth/controllers/googleCallback.controller.ts b/src/modules/auth/controllers/googleCallback.controller.ts index 9ae69d8..af05c6c 100644 --- a/src/modules/auth/controllers/googleCallback.controller.ts +++ b/src/modules/auth/controllers/googleCallback.controller.ts @@ -5,7 +5,7 @@ import { googleCallbackService } from "../services/http/googleCallback.service"; import { getUserHeaderInformation } from "../../../helpers/http/userHeader/getUserHeaderInformation"; export const googleCallbackController = async ( - ctx: Context & { query: { code: string; state: string } } + ctx: Context & { query: { code: string; state: string; callbackURI: string } } ) => { try { const userHeaderInfo = getUserHeaderInformation(ctx); diff --git a/src/modules/auth/services/http/googleCallback.service.ts b/src/modules/auth/services/http/googleCallback.service.ts index fedaedb..5b3ef35 100644 --- a/src/modules/auth/services/http/googleCallback.service.ts +++ b/src/modules/auth/services/http/googleCallback.service.ts @@ -10,6 +10,7 @@ export const googleCallbackService = async ( query: { state: string; code: string; + callbackURI?: string; }, userHeaderInfo: UserHeaderInformation ) => { @@ -25,7 +26,7 @@ export const googleCallbackService = async ( await redis.del(`${process.env.APP_NAME}:pkce:${state}`); // create access token with the result of validating the authorization code that compares access code with validator state - const google = googleProvider(); + const google = googleProvider(query.callbackURI); const tokens = await google.validateAuthorizationCode( query.code, codeVerifier