From 1852017a11c8e21f82943dd865fa99ed5accd79b Mon Sep 17 00:00:00 2001 From: Max Peintner Date: Wed, 7 May 2025 13:40:30 +0200 Subject: [PATCH 1/4] i18n ns --- apps/login/src/app/(login)/device/consent/page.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/login/src/app/(login)/device/consent/page.tsx b/apps/login/src/app/(login)/device/consent/page.tsx index 8cc9b4556f..c011da5730 100644 --- a/apps/login/src/app/(login)/device/consent/page.tsx +++ b/apps/login/src/app/(login)/device/consent/page.tsx @@ -15,7 +15,7 @@ export default async function Page(props: { }) { const searchParams = await props.searchParams; const locale = getLocale(); - const t = await getTranslations({ locale, namespace: "device" }); + const t = await getTranslations({ locale }); const userCode = searchParams?.user_code; const requestId = searchParams?.requestId; @@ -66,10 +66,12 @@ export default async function Page(props: {

- {t("request.title", { appName: deviceAuthorizationRequest?.appName })} + {t("device.request.title", { + appName: deviceAuthorizationRequest?.appName, + })}

-

{t("request.description")}

+

{t("device.request.description")}

Date: Wed, 7 May 2025 13:54:21 +0200 Subject: [PATCH 2/4] render appname --- apps/login/src/app/(login)/device/consent/page.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/login/src/app/(login)/device/consent/page.tsx b/apps/login/src/app/(login)/device/consent/page.tsx index c011da5730..75676cd7ff 100644 --- a/apps/login/src/app/(login)/device/consent/page.tsx +++ b/apps/login/src/app/(login)/device/consent/page.tsx @@ -71,7 +71,11 @@ export default async function Page(props: { })} -

{t("device.request.description")}

+

+ {t("device.request.description", { + appName: deviceAuthorizationRequest?.appName, + })} +

Date: Wed, 7 May 2025 14:00:17 +0200 Subject: [PATCH 3/4] autocomplete user code --- apps/login/src/app/(login)/device/page.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/apps/login/src/app/(login)/device/page.tsx b/apps/login/src/app/(login)/device/page.tsx index 4353ef5be4..1b262c41fc 100644 --- a/apps/login/src/app/(login)/device/page.tsx +++ b/apps/login/src/app/(login)/device/page.tsx @@ -37,13 +37,9 @@ export default async function Page(props: { return (
- {!userCode && ( - <> -

{t("usercode.title")}

-

{t("usercode.description")}

- - - )} +

{t("usercode.title")}

+

{t("usercode.description")}

+
); From 9df31eb9d6abc6ab4664a086180adf956c8b4174 Mon Sep 17 00:00:00 2001 From: Max Peintner Date: Wed, 7 May 2025 14:03:18 +0200 Subject: [PATCH 4/4] fallback to openid scope --- apps/login/src/components/consent.tsx | 39 +++++++++++++++------------ 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/apps/login/src/components/consent.tsx b/apps/login/src/components/consent.tsx index 30d5b4e407..d3d30b3113 100644 --- a/apps/login/src/components/consent.tsx +++ b/apps/login/src/components/consent.tsx @@ -43,28 +43,33 @@ export function ConsentScreen({ } } + const scopes = scope?.filter((s) => !!s); + return (
    - {scope - ?.filter((s) => !!s) - .map((s) => { - const translationKey = `device.scope.${s}`; - const description = t(translationKey, null); + {scopes?.length === 0 && ( + + {t("device.scope.openid")} + + )} + {scopes?.map((s) => { + const translationKey = `device.scope.${s}`; + const description = t(translationKey, null); - // Check if the key itself is returned and provide a fallback - const resolvedDescription = - description === translationKey ? "" : description; + // Check if the key itself is returned and provide a fallback + const resolvedDescription = + description === translationKey ? "" : description; - return ( -
  • - {resolvedDescription} -
  • - ); - })} + return ( +
  • + {resolvedDescription} +
  • + ); + })}