🚧 (wip) try to add callback uri option
This commit is contained in:
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user