mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-13 16:53:05 +00:00
i18n, cleanup layout
This commit is contained in:
@@ -4,12 +4,16 @@ import { RegisterU2f } from "@/components/register-u2f";
|
||||
import { UserAvatar } from "@/components/user-avatar";
|
||||
import { loadMostRecentSession } from "@/lib/session";
|
||||
import { getBrandingSettings } from "@/lib/zitadel";
|
||||
import { getLocale, getTranslations } from "next-intl/server";
|
||||
|
||||
export default async function Page({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: Record<string | number | symbol, string | undefined>;
|
||||
}) {
|
||||
const locale = getLocale();
|
||||
const t = await getTranslations({ locale, namespace: "u2f" });
|
||||
|
||||
const { loginName, organization, authRequestId, checkAfter } = searchParams;
|
||||
|
||||
const sessionFactors = await loadMostRecentSession({
|
||||
@@ -17,16 +21,12 @@ export default async function Page({
|
||||
organization,
|
||||
});
|
||||
|
||||
const title = "Use your passkey to confirm it's really you";
|
||||
const description =
|
||||
"Your device will ask for your fingerprint, face, or screen lock";
|
||||
|
||||
const branding = await getBrandingSettings(organization);
|
||||
|
||||
return (
|
||||
<DynamicTheme branding={branding}>
|
||||
<div className="flex flex-col items-center space-y-4">
|
||||
<h1>{title}</h1>
|
||||
<h1>{t("set.title")}</h1>
|
||||
|
||||
{sessionFactors && (
|
||||
<UserAvatar
|
||||
@@ -36,14 +36,11 @@ export default async function Page({
|
||||
searchParams={searchParams}
|
||||
></UserAvatar>
|
||||
)}
|
||||
<p className="ztdl-p mb-6 block">{description}</p>
|
||||
<p className="ztdl-p mb-6 block">{t("set.description")}</p>
|
||||
|
||||
{!sessionFactors && (
|
||||
<div className="py-4">
|
||||
<Alert>
|
||||
Could not get the context of the user. Make sure to enter the
|
||||
username first or provide a loginName as searchParam.
|
||||
</Alert>
|
||||
<Alert>{t("error:unknownContext")}</Alert>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user