Merged in feat/sas-otp-error-handling (pull request #1272)

Feat/sas otp error handling

* Improve error handling for SAS OTP
* Remove failing and deprecated test

Approved-by: Joakim Jäderberg
This commit is contained in:
Anton Gunnarsson
2025-02-07 14:18:00 +00:00
parent fbe05eb456
commit 18288cb849
11 changed files with 187 additions and 94 deletions

View File

@@ -1,9 +1,12 @@
import Body from "@/components/TempDesignSystem/Text/Body"
import { getIntl } from "@/i18n"
import { AlreadyLinkedError } from "../components/AlreadyLinkedError"
import { DateOfBirthError } from "../components/DateOfBirthError"
import { GenericError } from "../components/GenericError"
import { SASModalContactBlock } from "../components/SASModal"
import { TooManyCodesError } from "../components/TooManyCodesError"
import { TooManyFailedAttemptsError } from "../components/TooManyFailedAttemptsError"
import type { LangParams, PageArgs, SearchParams } from "@/types/params"
@@ -13,10 +16,24 @@ export default async function Page({
}: PageArgs<LangParams> & SearchParams<{ errorCode?: "dateOfBirthMismatch" }>) {
const intl = await getIntl()
if (searchParams.errorCode === "dateOfBirthMismatch") {
const { errorCode } = searchParams
if (errorCode === "dateOfBirthMismatch") {
return <DateOfBirthError />
}
if (errorCode === "tooManyFailedAttempts") {
return <TooManyFailedAttemptsError />
}
if (errorCode === "tooManyCodes") {
return <TooManyCodesError />
}
if (errorCode === "alreadyLinked") {
return <AlreadyLinkedError />
}
return (
<GenericError
title={intl.formatMessage({