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