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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user