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

View File

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