show error

This commit is contained in:
Max Peintner
2024-12-27 11:55:35 +01:00
parent aa6a597191
commit ab2136d5ab
2 changed files with 12 additions and 8 deletions

View File

@@ -84,6 +84,7 @@ export default async function Page(props: {
userId,
);
} catch (error) {
console.error(error);
return linkingFailed(branding);
}
@@ -137,6 +138,7 @@ export default async function Page(props: {
foundUser.userId,
);
} catch (error) {
console.error(error);
return linkingFailed(branding);
}

View File

@@ -3,7 +3,10 @@ import { getLocale, getTranslations } from "next-intl/server";
import { Alert, AlertType } from "../../alert";
import { DynamicTheme } from "../../dynamic-theme";
export async function linkingFailed(branding?: BrandingSettings) {
export async function linkingFailed(
branding?: BrandingSettings,
error?: string,
) {
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "idp" });
@@ -11,13 +14,12 @@ export async function linkingFailed(branding?: BrandingSettings) {
<DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4">
<h1>{t("linkingError.title")}</h1>
<div className="w-full">
{
<Alert type={AlertType.ALERT}>
{t("linkingError.description")}
</Alert>
}
</div>
<p className="ztdl-p">{t("linkingError.description")}</p>
{error && (
<div className="w-full">
{<Alert type={AlertType.ALERT}>{error}</Alert>}
</div>
)}
</div>
</DynamicTheme>
);