diff --git a/src/components/Authentication/Kratos/KratosAuthSessionChecker.tsx b/src/components/Authentication/Kratos/KratosAuthSessionChecker.tsx index d3801598f..ac462cbd0 100644 --- a/src/components/Authentication/Kratos/KratosAuthSessionChecker.tsx +++ b/src/components/Authentication/Kratos/KratosAuthSessionChecker.tsx @@ -29,21 +29,13 @@ export default function KratosAuthSessionChecker({ const url = window.location.pathname; switch ((err as AxiosError).response?.status) { case 403: - // This is a legacy error code thrown. See code 422 for - // more details. push(`/login?aal=aal2&return_to=${url}`); - return; break; case 422: - // This status code is returned when we are trying to - // validate a session which has not yet completed - // it's second factor push(`/login?aal=aal2&return_to=${url}`); - return; break; case 401: push(`/login?return_to=${url}`); - return; break; default: throw err; diff --git a/src/components/Authentication/Kratos/KratosLogin.tsx b/src/components/Authentication/Kratos/KratosLogin.tsx index defeba302..bc6ab08cc 100644 --- a/src/components/Authentication/Kratos/KratosLogin.tsx +++ b/src/components/Authentication/Kratos/KratosLogin.tsx @@ -68,11 +68,12 @@ const Login: NextPage = () => { updateLoginFlowBody: values }); if (flow?.return_to) { - await router.push(flow?.return_to); + window.location.href = flow?.return_to; } else { await router.push("/"); } } catch (err: any) { + console.error(err); await handleFlowError(router, "login", setFlow)(err); if (err.response?.status === 400) { setFlow((err.response as any).data);