Merged in fix/sw-2132-unlink-error (pull request #1816)

Add UnlinkError for when SAS account unlinking fails

* Add UnlinkError for when unlinking fails


Approved-by: Joakim Jäderberg
This commit is contained in:
Anton Gunnarsson
2025-04-16 11:19:07 +00:00
parent 8b65f63d60
commit 0ab5dc1c9d
3 changed files with 36 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
"use client"
import { useIntl } from "react-intl"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { GenericError } from "./GenericError"
import { SASModalContactBlock } from "./SASModal"
export function UnlinkError() {
const intl = useIntl()
return (
<GenericError
title={intl.formatMessage({
defaultMessage: "We could not unlink your accounts",
})}
>
<Typography variant="Body/Paragraph/mdRegular">
<p>
{intl.formatMessage({
defaultMessage:
"We couldnt unlink your accounts. Please contact us and well help you resolve this.",
})}
</p>
</Typography>
<SASModalContactBlock />
</GenericError>
)
}

View File

@@ -8,6 +8,7 @@ import { GenericError } from "../components/GenericError"
import { SASModalContactBlock } from "../components/SASModal"
import { TooManyCodesError } from "../components/TooManyCodesError"
import { TooManyFailedAttemptsError } from "../components/TooManyFailedAttemptsError"
import { UnlinkError } from "../components/UnlinkError"
import type { LangParams, PageArgs, SearchParams } from "@/types/params"
@@ -34,6 +35,10 @@ export default async function Page({
return <AlreadyLinkedError />
}
if (errorCode === "unlinkError") {
return <UnlinkError />
}
return (
<GenericError
title={intl.formatMessage({

View File

@@ -223,7 +223,7 @@ async function handleUnlinkAccount({
}
case "error":
return {
url: `/${lang}/sas-x-scandic/error`,
url: `/${lang}/sas-x-scandic/error?errorCode=unlinkError`,
type: "replace",
}
}