mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 15:07:32 +00:00
@@ -15,7 +15,7 @@ export default async function Page(props: {
|
|||||||
}) {
|
}) {
|
||||||
const searchParams = await props.searchParams;
|
const searchParams = await props.searchParams;
|
||||||
const locale = getLocale();
|
const locale = getLocale();
|
||||||
const t = await getTranslations({ locale, namespace: "device" });
|
const t = await getTranslations({ locale });
|
||||||
|
|
||||||
const userCode = searchParams?.user_code;
|
const userCode = searchParams?.user_code;
|
||||||
const requestId = searchParams?.requestId;
|
const requestId = searchParams?.requestId;
|
||||||
@@ -66,10 +66,16 @@ export default async function Page(props: {
|
|||||||
<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>
|
<h1>
|
||||||
{t("request.title", { appName: deviceAuthorizationRequest?.appName })}
|
{t("device.request.title", {
|
||||||
|
appName: deviceAuthorizationRequest?.appName,
|
||||||
|
})}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<p className="ztdl-p">{t("request.description")}</p>
|
<p className="ztdl-p">
|
||||||
|
{t("device.request.description", {
|
||||||
|
appName: deviceAuthorizationRequest?.appName,
|
||||||
|
})}
|
||||||
|
</p>
|
||||||
|
|
||||||
<ConsentScreen
|
<ConsentScreen
|
||||||
deviceAuthorizationRequestId={deviceAuthorizationRequest?.id}
|
deviceAuthorizationRequestId={deviceAuthorizationRequest?.id}
|
||||||
|
@@ -37,13 +37,9 @@ export default async function Page(props: {
|
|||||||
return (
|
return (
|
||||||
<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">
|
||||||
{!userCode && (
|
<h1>{t("usercode.title")}</h1>
|
||||||
<>
|
<p className="ztdl-p">{t("usercode.description")}</p>
|
||||||
<h1>{t("usercode.title")}</h1>
|
<DeviceCodeForm userCode={userCode}></DeviceCodeForm>
|
||||||
<p className="ztdl-p">{t("usercode.description")}</p>
|
|
||||||
<DeviceCodeForm userCode={userCode}></DeviceCodeForm>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</DynamicTheme>
|
</DynamicTheme>
|
||||||
);
|
);
|
||||||
|
@@ -43,28 +43,33 @@ export function ConsentScreen({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const scopes = scope?.filter((s) => !!s);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="pt-4 w-full flex flex-col items-center space-y-4">
|
<div className="pt-4 w-full flex flex-col items-center space-y-4">
|
||||||
<ul className="list-disc space-y-2 w-full">
|
<ul className="list-disc space-y-2 w-full">
|
||||||
{scope
|
{scopes?.length === 0 && (
|
||||||
?.filter((s) => !!s)
|
<span className="w-full text-sm flex flex-row items-center bg-background-light-400 dark:bg-background-dark-400 border border-divider-light py-2 px-4 rounded-md transition-all">
|
||||||
.map((s) => {
|
{t("device.scope.openid")}
|
||||||
const translationKey = `device.scope.${s}`;
|
</span>
|
||||||
const description = t(translationKey, null);
|
)}
|
||||||
|
{scopes?.map((s) => {
|
||||||
|
const translationKey = `device.scope.${s}`;
|
||||||
|
const description = t(translationKey, null);
|
||||||
|
|
||||||
// Check if the key itself is returned and provide a fallback
|
// Check if the key itself is returned and provide a fallback
|
||||||
const resolvedDescription =
|
const resolvedDescription =
|
||||||
description === translationKey ? "" : description;
|
description === translationKey ? "" : description;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li
|
<li
|
||||||
key={s}
|
key={s}
|
||||||
className="w-full text-sm flex flex-row items-center bg-background-light-400 dark:bg-background-dark-400 border border-divider-light py-2 px-4 rounded-md transition-all"
|
className="w-full text-sm flex flex-row items-center bg-background-light-400 dark:bg-background-dark-400 border border-divider-light py-2 px-4 rounded-md transition-all"
|
||||||
>
|
>
|
||||||
<span>{resolvedDescription}</span>
|
<span>{resolvedDescription}</span>
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p className="ztdl-p text-xs text-left">
|
<p className="ztdl-p text-xs text-left">
|
||||||
|
Reference in New Issue
Block a user