🚧 (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";
|
import { getUserHeaderInformation } from "../../../helpers/http/userHeader/getUserHeaderInformation";
|
||||||
|
|
||||||
export const googleCallbackController = async (
|
export const googleCallbackController = async (
|
||||||
ctx: Context & { query: { code: string; state: string } }
|
ctx: Context & { query: { code: string; state: string; callbackURI: string } }
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
const userHeaderInfo = getUserHeaderInformation(ctx);
|
const userHeaderInfo = getUserHeaderInformation(ctx);
|
||||||
|
|||||||
@ -10,6 +10,7 @@ export const googleCallbackService = async (
|
|||||||
query: {
|
query: {
|
||||||
state: string;
|
state: string;
|
||||||
code: string;
|
code: string;
|
||||||
|
callbackURI?: string;
|
||||||
},
|
},
|
||||||
userHeaderInfo: UserHeaderInformation
|
userHeaderInfo: UserHeaderInformation
|
||||||
) => {
|
) => {
|
||||||
@ -25,7 +26,7 @@ export const googleCallbackService = async (
|
|||||||
await redis.del(`${process.env.APP_NAME}:pkce:${state}`);
|
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
|
// 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(
|
const tokens = await google.validateAuthorizationCode(
|
||||||
query.code,
|
query.code,
|
||||||
codeVerifier
|
codeVerifier
|
||||||
|
|||||||
Reference in New Issue
Block a user