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)