From a27075b29e41e5031b5b7be06a8bf62289344767 Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Fri, 21 Jun 2024 10:38:14 +0500 Subject: [PATCH] Fix oAuth (#5885) Signed-off-by: Denis Bykhov --- pods/authProviders/src/github.ts | 2 +- pods/authProviders/src/google.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pods/authProviders/src/github.ts b/pods/authProviders/src/github.ts index a077a2a027..2e073b3cf7 100644 --- a/pods/authProviders/src/github.ts +++ b/pods/authProviders/src/github.ts @@ -55,7 +55,7 @@ export function registerGithub ( const state = safeParseAuthState(ctx.query?.state) const branding = getBranding(brandings, state?.branding) - passport.authenticate('github', { + await passport.authenticate('github', { failureRedirect: concatLink(branding?.front ?? frontUrl, '/login'), session: true })(ctx, next) diff --git a/pods/authProviders/src/google.ts b/pods/authProviders/src/google.ts index f39b223f35..c0237ab5fd 100644 --- a/pods/authProviders/src/google.ts +++ b/pods/authProviders/src/google.ts @@ -58,8 +58,7 @@ export function registerGoogle ( measureCtx.info('With branding', { branding }) const failureRedirect = concatLink(branding?.front ?? frontUrl, '/login') measureCtx.info('With failure redirect', { failureRedirect }) - - passport.authenticate('google', { + await passport.authenticate('google', { failureRedirect, session: true })(ctx, next)