Skip to content

Commit 23d87b3

Browse files
committed
chore(device): guide the user during device auth
The flow is now: 1. Consent page: button says "Allow & Sign In" + notice "You'll need to sign in to complete the authorization." 2. Login page: info banner "Sign in to authorize the device and complete the connection."
1 parent 99cf935 commit 23d87b3

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

apps/login/locales/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"loginname": {
2323
"title": "Welcome",
2424
"description": "Choose your login method:",
25+
"deviceAuthNotice": "Sign in to authorize the device and complete the connection.",
2526
"register": "Create account",
2627
"submit": "Continue",
2728
"notRegistered": "Not registered?",
@@ -266,7 +267,8 @@
266267
"title": "{appName} would like to connect",
267268
"description": "{appName} will have access to:",
268269
"disclaimer": "By clicking Allow, you allow {appName} and Zitadel to use your information in accordance with their respective terms of service and privacy policies. You can revoke this access at any time.",
269-
"submit": "Allow",
270+
"signInNotice": "You'll need to sign in to complete the authorization.",
271+
"submit": "Allow & Sign In",
270272
"deny": "Deny"
271273
},
272274
"scope": {

apps/login/src/app/(main)/(illustration)/loginname/page.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Alert, AlertType } from "@/components/alert";
12
import { SignInWithIdp } from "@/components/sign-in-with-idp";
23
import { Translated } from "@/components/translated";
34
import { UsernameForm } from "@/components/username-form";
@@ -59,6 +60,8 @@ export default async function Page(props: {
5960

6061
const lastUsedIdpId = await getLastUsedIdpId();
6162

63+
const isDeviceAuth = requestId?.startsWith("device_");
64+
6265
return (
6366
<>
6467
<h1>
@@ -68,6 +71,12 @@ export default async function Page(props: {
6871
<Translated i18nKey="description" namespace="loginname" />
6972
</p>
7073

74+
{isDeviceAuth && (
75+
<Alert type={AlertType.INFO}>
76+
<Translated i18nKey="deviceAuthNotice" namespace="loginname" />
77+
</Alert>
78+
)}
79+
7180
{loginSettings?.allowUsernamePassword && (
7281
<>
7382
<UsernameForm

apps/login/src/components/consent.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ export function ConsentScreen({
8181
/>
8282
</p>
8383

84+
<p className="ztdl-p text-xs text-left font-medium">
85+
<Translated i18nKey="request.signInNotice" namespace="device" />
86+
</p>
87+
8488
{error && (
8589
<div className="py-4">
8690
<Alert>{error}</Alert>

0 commit comments

Comments
 (0)