fix mfa login after keycloak

This commit is contained in:
Danel Kungla
2025-10-04 17:36:36 +03:00
parent 7d90b5b910
commit 3f17b82fdb
5 changed files with 58 additions and 14 deletions

View File

@@ -47,6 +47,11 @@ export async function GET(request: NextRequest) {
const service = createAuthCallbackService(getSupabaseServerClient());
const oauthResult = await service.exchangeCodeForSession(authCode);
if (oauthResult.requiresMultiFactorAuthentication) {
redirect(pathsConfig.auth.verifyMfa);
}
if (!('isSuccess' in oauthResult)) {
return redirectOnError(oauthResult.searchParams);
}

View File

@@ -44,12 +44,7 @@ async function VerifyPage(props: Props) {
!!nextPath && nextPath.length > 0 ? nextPath : pathsConfig.app.home;
return (
<MultiFactorChallengeContainer
userId={user.id}
paths={{
redirectPath,
}}
/>
<MultiFactorChallengeContainer userId={user.id} paths={{ redirectPath }} />
);
}