Skip to content

Commit a8e794f

Browse files
fix(console): keep the OAuth consent page finished after a decision, with an outcome card for app-scheme redirects (#34369)
<!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9STQV6FBnGhfrvF3mZr4ymB)_ Fixes #34349 Clause-②: no Metadata-protocol: none ## 维护者速读 - **改了什么**:OAuth 同意页一旦提交了授权/拒绝并拿到跳转地址,就进入终态,按钮不再恢复可点;跳转是 App 协议(如 `workbuddy://`)时,页面换成结果卡:已授权/已拒绝、「返回该应用,可关闭此标签页」,外加一个再次打开该应用的链接。 - **为什么改**:WorkBuddy 等桌面客户端用自定义协议回调,浏览器把地址交给系统后标签页不离开,同意卡原样回来、按钮又可点;用户以为没成功,再点一次就用已作废的请求重提,弹出「Consent failed」。 - **风险与回滚**:只改 Console 同意页与语言包,无服务端/契约改动;`http(s)` 回调(含 loopback)照旧整页跳走,服务端拒绝时照旧提示并恢复按钮。回滚即 revert 本 PR。 - **先看**:`ui/apps/console/src/pages/auth/OAuthConsentPage.tsx` 的 `handleDecision`(`terminal` 与 `setHandedOff`)和新增的结果卡分支;其次同目录 `__tests__/OAuthConsentPage.public-client-12301.test.tsx` 末尾的 `after a decision` 一组。 - **两分钟验证**:`pnpm --dir ui exec vitest run apps/console/src/pages/auth/__tests__/OAuthConsentPage.public-client-12301.test.tsx`,预期 28 个测试全过。 - **需要你做的**:无,席位落地。 ## What changes - `OAuthConsentPage.handleDecision`: once the server answers a decision with a redirect, the signed query is spent, so the page is terminal for every redirect kind. The `finally` no longer re-enables Authorize and Deny after a redirect (`terminal` flag); a decision the server refuses (no redirect, non-2xx) still toasts and re-enables them as before. - A redirect that is not `http(s)` (a native app's custom scheme) is still handed to the browser (`window.location.assign`), and the page replaces the consent card with an outcome card (`data-testid="oauth-consent-handed-off"`): "Access granted" / "Access denied" (the existing `granted` / `denied` keys), "Return to APP to continue. You can close this tab.", and an "Open APP" link whose `href` is the same redirect, in case the browser's open-the-app prompt was dismissed. With no identified client name, the unnamed forms are used. - The http(s)-or-not test is the one `redirectDestination` already used, extracted as `webRedirectHost` beside it; `redirectDestination` now calls it, so there is one copy of the test. - The tab navigation is now spelled `window.location.assign(redirect)` instead of assigning `window.location.href` (same navigation; it makes the location write observable to the pins). - `window.close()` is not attempted. - i18n: four new keys under `oauth.consent` (`returnToApp`, `returnToUnnamedApp`, `openApp`, `openUnnamedApp`) in all eleven Console packs; zh-Hant generated with `pnpm --filter @object-ui/i18n gen:zh-hant`. - Changeset: `.changeset/34349-oauth-consent-app-scheme-terminal.md` (`@object-ui/console`, `@object-ui/i18n`: patch). ## Tests New top-level `describe('OAuthConsentPage — after a decision')` in the existing shared harness file `OAuthConsentPage.public-client-12301.test.tsx` (its `stubLookup` gained an optional decision answer): - Authorize, and Deny, with a `workbuddy://` redirect: the outcome card shows the outcome and the app name, the "Open" link carries the redirect, `location.assign` was called once with it, no button is left on the page, and exactly one decision POST was sent with `{ accept, oauth_query }`. - An unidentified client: the outcome card uses the unnamed forms. - CONTROL, an `https://` redirect and a loopback `http://127.0.0.1` redirect: `location.assign` is called with the redirect, no outcome card, and Authorize / Deny stay disabled after the decision settles. - CONTROL, a refused decision (400): buttons are disabled while in flight, enabled again after, consent card kept, no navigation. No forced edits to existing tests. ## Acceptance notes - None filed. The other two consent test files (`agent-scopes-12853`, `mcp-scopes-26587`) were not touched. ## Verification <details><summary>Tests (head after the last code commit)</summary> - `pnpm --dir ui exec vitest run apps/console/src/pages/auth/__tests__/OAuthConsentPage.public-client-12301.test.tsx` → Test Files 1 passed, Tests 28 passed. - `pnpm --dir ui exec vitest run apps/console/src/pages/auth/__tests__/ packages/i18n/` → 137 files, run before the label fix: only the three new pins that looked up the in-flight "Authorizing…" label failed; fixed in the next commit and the file re-run green (above). - `pnpm --filter @object-ui/console --filter @object-ui/i18n run type-check` → both Done, lock VERDICT command-exit 0. - `pnpm --dir ui exec eslint` on the two changed console files → exit 0. `pnpm --dir ui run check:new-line-citations` → 0 new citations. </details> <details><summary>Ablations (scripts/ablation-replace.mjs, mutation proven on disk, restored to HEAD blob 51a03ea)</summary> - A: `if (!terminal) setSubmitting(false);` → `setSubmitting(false);` (buttons re-armed after a redirect): the two http(s) CONTROL pins go red (2 failed / 26 passed). - B: delete `if (webRedirectHost(redirect) === null) setHandedOff({ accept, redirect });` (no outcome card): the Authorize, Deny and unnamed custom-scheme pins go red (3 failed / 25 passed). </details> <details><summary>Derived gate families</summary> Head `6b6a0a53`, `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` (same list re-derived on this head): 40 commands, all exit 0. `--ran` reconciliation: 40 derived, 40 run, 0 NOT-MEASURED, 0 UNRUN. ```text node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0 node scripts/check-adr-0087-registration.mjs --self-test :: exit 0 node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0 node scripts/check-closing-keyword-parity.mjs :: exit 0 node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0 node scripts/check-comment-mask-corpus.mjs :: exit 0 node scripts/check-empty-changeset.mjs --base origin/main :: exit 0 node scripts/check-empty-changeset.mjs --self-test :: exit 0 node scripts/check-sdui-manifest.mjs :: exit 0 node scripts/check-sdui-manifest.mjs --self-test :: exit 0 node scripts/ci/snapshot-next.mjs --self-test :: exit 0 node scripts/pm/check-governed-queue-guard.mjs --self-test :: exit 0 node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0 node scripts/release-pending-publish.mjs --self-test :: exit 0 pnpm --dir ui exec vitest run scripts/ :: exit 0 pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0 pnpm check:adr-anchors :: exit 0 pnpm check:changeset-gate-self-tests :: exit 0 pnpm check:closed-ceremony-text :: exit 0 pnpm check:cross-package-test-inputs :: exit 0 pnpm check:dispatcher-error-vocabulary :: exit 0 pnpm check:driver-memory-census :: exit 0 pnpm check:engine-double-contract :: exit 0 pnpm check:gitlink-declared :: exit 0 pnpm check:merge-driver :: exit 0 pnpm check:nul-bytes :: exit 0 pnpm check:published-files :: exit 0 pnpm check:query-options-erasure :: exit 0 pnpm check:refd-timer-probe :: exit 0 pnpm check:registry-log-declared :: exit 0 pnpm check:rest-log-spy-declared :: exit 0 pnpm check:role-word :: exit 0 pnpm check:skill-identifier-liveness :: exit 0 pnpm check:test-source-alias :: exit 0 pnpm check:tier-file-adoption :: exit 0 pnpm check:type-check-coverage :: exit 0 pnpm check:type-check-debt :: exit 0 pnpm check:undeclared-dep-imports :: exit 0 pnpm check:watch-hint-literal :: exit 0 pnpm check:where-matcher :: exit 0 ``` Every family CI runs is read from this PR's check-runs, not re-run here. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmRAAikoiFeHPhvRdyB)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 719b6b5 commit a8e794f

14 files changed

Lines changed: 264 additions & 9 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@object-ui/console': patch
3+
'@object-ui/i18n': patch
4+
---
5+
6+
fix(console): the OAuth consent page stays finished after Authorize or Deny when the client's redirect is an app scheme
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
Desktop and native MCP clients (such as WorkBuddy) register a redirect with their own scheme (`workbuddy://…`). After Authorize, the browser hands that address to the app but keeps the tab where it is. The consent page then put its card back with Authorize and Deny enabled again. A person could not tell that the connection had worked, and a second click sent the already-used request again and showed "Consent failed".
12+
13+
Once the server answers a decision with a redirect, the page now treats the request as finished and never enables the buttons again. For an app-scheme redirect it replaces the consent card with the outcome ("Access granted" or "Access denied"). It tells the person to return to the application and that they can close the tab. It also shows an "Open" link to the same redirect, in case the browser's prompt to open the app was dismissed. An `http(s)` redirect, including a loopback one, still navigates the tab away as before. A decision the server refuses still shows the error and enables the buttons again. The new sentences are in every Console language pack.

‎ui/apps/console/src/pages/auth/OAuthConsentPage.tsx‎

Lines changed: 81 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@
4242
* included. Until the server has answered, Authorize is
4343
* disabled; when it cannot answer, the page says the destination could not be
4444
* confirmed and Authorize stays disabled. Deny always works.
45+
*
46+
* ## After a decision
47+
*
48+
* Once the server has answered a decision with a redirect, the signed query is
49+
* spent, so the page is terminal: Authorize and Deny are never enabled again.
50+
* An `http(s)` redirect navigates the tab away. Any other redirect (a native
51+
* app's custom scheme) is handed to the operating system and leaves this tab
52+
* where it is, so the page replaces the consent card with the outcome, tells
53+
* the person to return to the application, and offers a link that opens the
54+
* same redirect again. A decision the server refused keeps the consent card
55+
* and enables the buttons again.
4556
*/
4657

4758
import { useEffect, useState } from 'react';
@@ -93,19 +104,31 @@ const REQUEST_PENDING: RequestLookup = { state: 'pending' };
93104
const REQUEST_UNCONFIRMED: RequestLookup = { state: 'unconfirmed' };
94105

95106
/**
96-
* Where a redirect sends the grant, as a person reads it: the host (with its
97-
* port) of an `http(s)` redirect, and any other redirect exactly as it is.
107+
* The host (with its port) of an `http(s)` redirect, the kind a browser tab
108+
* navigates to; `null` for any other redirect (a native app's custom scheme,
109+
* which the operating system takes and the tab never leaves for).
98110
*/
99-
function redirectDestination(redirectUri: string): string {
111+
function webRedirectHost(redirectUri: string): string | null {
100112
try {
101113
const url = new URL(redirectUri);
102114
if ((url.protocol === 'https:' || url.protocol === 'http:') && url.host) return url.host;
103115
} catch {
104-
// Not a URL the platform can parse: shown as it is.
116+
// Not a URL the platform can parse: not a web redirect.
105117
}
106-
return redirectUri;
118+
return null;
119+
}
120+
121+
/**
122+
* Where a redirect sends the grant, as a person reads it: the host (with its
123+
* port) of an `http(s)` redirect, and any other redirect exactly as it is.
124+
*/
125+
function redirectDestination(redirectUri: string): string {
126+
return webRedirectHost(redirectUri) ?? redirectUri;
107127
}
108128

129+
/** A decision the server answered with a redirect the tab does not leave for. */
130+
type HandedOff = { accept: boolean; redirect: string };
131+
109132
/** Read the server's account of the signed request. */
110133
async function readConsentRequest(res: Response): Promise<RequestLookup> {
111134
if (!res.ok) return REQUEST_UNCONFIRMED;
@@ -135,6 +158,7 @@ export function OAuthConsentPage() {
135158
const navigate = useNavigate();
136159
const { user, isLoading } = useAuth();
137160
const [submitting, setSubmitting] = useState(false);
161+
const [handedOff, setHandedOff] = useState<HandedOff | null>(null);
138162
// Keyed by the client id it answers for, so the lookup below is derived
139163
// rather than reset from an effect.
140164
const [answer, setAnswer] = useState<{ clientId: string; lookup: ClientLookup } | null>(null);
@@ -213,6 +237,9 @@ export function OAuthConsentPage() {
213237

214238
const handleDecision = async (accept: boolean) => {
215239
setSubmitting(true);
240+
// Set once the server has answered with a redirect: the signed query is
241+
// spent, so the buttons are never enabled again.
242+
let terminal = false;
216243
try {
217244
const res = await fetch(`${AUTH_BASE}/oauth2/consent`, {
218245
method: 'POST',
@@ -232,7 +259,9 @@ export function OAuthConsentPage() {
232259
(data as { redirectURI?: string }).redirectURI ??
233260
(data as { url?: string }).url;
234261
if (redirect) {
235-
window.location.href = redirect;
262+
terminal = true;
263+
if (webRedirectHost(redirect) === null) setHandedOff({ accept, redirect });
264+
window.location.assign(redirect);
236265
return;
237266
}
238267
const title = accept
@@ -249,13 +278,58 @@ export function OAuthConsentPage() {
249278
{ description: (err as Error).message },
250279
);
251280
} finally {
252-
setSubmitting(false);
281+
if (!terminal) setSubmitting(false);
253282
}
254283
};
255284

256285
const appName =
257286
identified?.name ?? t('oauth.consent.unknownApp', { defaultValue: 'an application' });
258287

288+
if (handedOff) {
289+
return (
290+
<div className="flex min-h-svh w-full flex-1 items-center justify-center bg-background px-4">
291+
<Card className="w-full max-w-md" data-testid="oauth-consent-handed-off">
292+
<CardHeader className="items-center text-center">
293+
<div className="mb-3 rounded-full border bg-muted p-3">
294+
{handedOff.accept ? (
295+
<Check className="h-7 w-7 text-green-600 dark:text-green-400" />
296+
) : (
297+
<X className="h-7 w-7 text-muted-foreground" />
298+
)}
299+
</div>
300+
<CardTitle className="text-xl">
301+
{handedOff.accept
302+
? t('oauth.consent.granted', { defaultValue: 'Access granted' })
303+
: t('oauth.consent.denied', { defaultValue: 'Access denied' })}
304+
</CardTitle>
305+
<CardDescription>
306+
{identified
307+
? t('oauth.consent.returnToApp', {
308+
appName: identified.name,
309+
defaultValue: `Return to ${identified.name} to continue. You can close this tab.`,
310+
})
311+
: t('oauth.consent.returnToUnnamedApp', {
312+
defaultValue: 'Return to the application to continue. You can close this tab.',
313+
})}
314+
</CardDescription>
315+
</CardHeader>
316+
<CardContent>
317+
<Button asChild variant="outline" className="w-full">
318+
<a href={handedOff.redirect} data-testid="oauth-consent-open-app">
319+
{identified
320+
? t('oauth.consent.openApp', {
321+
appName: identified.name,
322+
defaultValue: `Open ${identified.name}`,
323+
})
324+
: t('oauth.consent.openUnnamedApp', { defaultValue: 'Open the application' })}
325+
</a>
326+
</Button>
327+
</CardContent>
328+
</Card>
329+
</div>
330+
);
331+
}
332+
259333
return (
260334
<div className="flex min-h-svh w-full flex-1 items-center justify-center bg-background px-4">
261335
<Card className="w-full max-w-md">

‎ui/apps/console/src/pages/auth/__tests__/OAuthConsentPage.public-client-12301.test.tsx‎

Lines changed: 122 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*/
2626

2727
import { describe, it, expect, vi, afterEach } from 'vitest';
28-
import { render, screen, cleanup, within, waitFor } from '@testing-library/react';
28+
import { render, screen, cleanup, within, waitFor, fireEvent } from '@testing-library/react';
2929
import { MemoryRouter, Route, Routes } from 'react-router-dom';
3030
import { ObjectStackClient } from '@objectstack/client';
3131
import { AuthProvider } from '@object-ui/auth';
@@ -53,6 +53,7 @@ const ADMIN_REGISTERED: Answer = {
5353
};
5454

5555
const CONSENT_REQUEST_PATH = '/api/v1/auth/oauth-consent/request';
56+
const CONSENT_DECISION_PATH = '/api/v1/auth/oauth2/consent';
5657

5758
function respond(answer: Answer) {
5859
if (answer.kind === 'never') return new Promise(() => {});
@@ -67,6 +68,7 @@ function respond(answer: Answer) {
6768
afterEach(() => {
6869
cleanup();
6970
vi.unstubAllGlobals();
71+
vi.restoreAllMocks();
7072
});
7173

7274
/** The URL `@objectstack/client` requests for `oauth.applications.getPublic`. */
@@ -94,11 +96,16 @@ function authClient(signedIn: boolean): AuthClient {
9496
} as unknown as AuthClient;
9597
}
9698

97-
function stubLookup(answer: Answer, request: Answer = ADMIN_REGISTERED) {
99+
function stubLookup(
100+
answer: Answer,
101+
request: Answer = ADMIN_REGISTERED,
102+
decision: () => ReturnType<typeof respond> = () => respond({ kind: 'http', status: 404, body: {} }),
103+
) {
98104
// Typed as `fetch` is called (input, init), so a recorded call reads as both.
99105
const fetchMock = vi.fn((input: unknown, _init?: RequestInit) => {
100106
const url = String(input);
101107
if (url.includes(CONSENT_REQUEST_PATH)) return respond(request);
108+
if (url.includes(CONSENT_DECISION_PATH)) return decision();
102109
if (!url.includes('/oauth2/public-client')) {
103110
return Promise.resolve({ ok: false, status: 404, json: async () => ({}) });
104111
}
@@ -319,3 +326,116 @@ describe('OAuthConsentPage — where the grant goes, and an unverified client',
319326
expect(denyButton().hasAttribute('disabled')).toBe(false);
320327
});
321328
});
329+
330+
/**
331+
* A posted decision answered with a redirect spends the signed query, so the
332+
* page never offers Authorize or Deny again. A redirect the tab does not leave
333+
* for (a native app's custom scheme) replaces the consent card with the
334+
* outcome and a link that opens the same redirect; an `http(s)` redirect keeps
335+
* navigating the tab away.
336+
*/
337+
describe('OAuthConsentPage — after a decision', () => {
338+
const APP_REDIRECT = 'workbuddy://workbuddy/mcp/custom-mcp%3Aobjectstack/oauth/callback';
339+
const decided = (redirect: string) => () =>
340+
respond({ kind: 'http', status: 200, body: { redirect_uri: redirect } });
341+
342+
// While a decision is in flight Authorize reads "Authorizing…".
343+
const authorizeOrPending = () => screen.getByRole('button', { name: /Authoriz/ });
344+
345+
function spyAssign() {
346+
return vi.spyOn(window.location, 'assign').mockImplementation(() => undefined);
347+
}
348+
349+
const decisionCalls = (fetchMock: ReturnType<typeof stubLookup>) =>
350+
fetchMock.mock.calls.filter(([input]) => String(input).includes(CONSENT_DECISION_PATH));
351+
352+
it.each<[string, () => HTMLElement, boolean, string]>([
353+
['Authorize', authorizeButton, true, 'Access granted'],
354+
['Deny', denyButton, false, 'Access denied'],
355+
])('%s with a custom-scheme redirect ends on the outcome, with no decision buttons left', async (_label, button, accept, outcome) => {
356+
const redirect = `${APP_REDIRECT}?${accept ? 'code=c1' : 'error=access_denied'}&state=s1`;
357+
const assign = spyAssign();
358+
const fetchMock = stubLookup(NAMED, requestAnswer(APP_REDIRECT, false), decided(redirect));
359+
renderConsent();
360+
361+
await screen.findByTestId('oauth-consent-destination');
362+
fireEvent.click(button());
363+
364+
const done = await screen.findByTestId('oauth-consent-handed-off');
365+
expect(within(done).getByText(outcome)).toBeTruthy();
366+
expect(within(done).getByText('Return to Acme Notes to continue. You can close this tab.')).toBeTruthy();
367+
const open = within(done).getByTestId('oauth-consent-open-app');
368+
expect(open.tagName).toBe('A');
369+
expect(open.getAttribute('href')).toBe(redirect);
370+
expect(open.textContent).toBe('Open Acme Notes');
371+
// The redirect is still handed to the operating system, exactly once.
372+
expect(assign).toHaveBeenCalledTimes(1);
373+
expect(assign).toHaveBeenCalledWith(redirect);
374+
// Nothing on the page can post the spent query again.
375+
expect(screen.queryAllByRole('button')).toHaveLength(0);
376+
expect(screen.queryByTestId('oauth-consent-destination')).toBeNull();
377+
const calls = decisionCalls(fetchMock);
378+
expect(calls).toHaveLength(1);
379+
expect(JSON.parse(String((calls[0] as [string, RequestInit])[1].body))).toEqual({
380+
accept,
381+
oauth_query: SEARCH.slice(1),
382+
});
383+
});
384+
385+
it('names no application on the outcome when the client was not identified', async () => {
386+
spyAssign();
387+
stubLookup({ kind: 'http', status: 404, body: {} }, requestAnswer(APP_REDIRECT, false), decided(`${APP_REDIRECT}?code=c1`));
388+
renderConsent();
389+
390+
await screen.findByTestId('oauth-consent-destination');
391+
fireEvent.click(authorizeButton());
392+
393+
const done = await screen.findByTestId('oauth-consent-handed-off');
394+
expect(within(done).getByText('Return to the application to continue. You can close this tab.')).toBeTruthy();
395+
expect(within(done).getByTestId('oauth-consent-open-app').textContent).toBe('Open the application');
396+
});
397+
398+
it.each<[string, string]>([
399+
['an https redirect', 'https://acme.example/cb?code=c1&state=s1'],
400+
['a loopback redirect', 'http://127.0.0.1:56789/callback?code=c1&state=s1'],
401+
])('CONTROL: %s keeps navigating the tab, shows no outcome card, and never enables the buttons again', async (_label, redirect) => {
402+
const assign = spyAssign();
403+
stubLookup(NAMED, requestAnswer(redirect, true), decided(redirect));
404+
renderConsent();
405+
406+
await screen.findByTestId('oauth-consent-destination');
407+
fireEvent.click(authorizeButton());
408+
409+
await waitFor(() => expect(assign).toHaveBeenCalledWith(redirect));
410+
expect(assign).toHaveBeenCalledTimes(1);
411+
// Let the decision's `finally` run before reading the buttons.
412+
await new Promise((resolve) => setTimeout(resolve, 0));
413+
expect(screen.queryByTestId('oauth-consent-handed-off')).toBeNull();
414+
expect(authorizeOrPending().hasAttribute('disabled')).toBe(true);
415+
expect(denyButton().hasAttribute('disabled')).toBe(true);
416+
});
417+
418+
it('CONTROL: a refused decision keeps the consent card and enables the buttons again', async () => {
419+
const assign = spyAssign();
420+
let refuse: (value: unknown) => void = () => {};
421+
const refused = new Promise((resolve) => {
422+
refuse = resolve;
423+
});
424+
stubLookup(NAMED, requestAnswer(APP_REDIRECT, false), () =>
425+
refused.then(() => respond({ kind: 'http', status: 400, body: { message: 'invalid_request' } })),
426+
);
427+
renderConsent();
428+
429+
await screen.findByTestId('oauth-consent-destination');
430+
fireEvent.click(authorizeButton());
431+
await waitFor(() => expect(denyButton().hasAttribute('disabled')).toBe(true));
432+
expect(authorizeOrPending().hasAttribute('disabled')).toBe(true);
433+
434+
refuse(undefined);
435+
await waitFor(() => expect(authorizeButton().hasAttribute('disabled')).toBe(false));
436+
expect(denyButton().hasAttribute('disabled')).toBe(false);
437+
expect(screen.queryByTestId('oauth-consent-handed-off')).toBeNull();
438+
expect(screen.getByTestId('oauth-consent-destination')).toBeTruthy();
439+
expect(assign).not.toHaveBeenCalled();
440+
});
441+
});

‎ui/packages/i18n/src/locales/ar.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3328,6 +3328,10 @@ const ar = {
33283328
granted: "تم منح الوصول",
33293329
denied: "تم رفض الوصول",
33303330
noRedirect: "لم يُرجع الخادم أي عنوان URL لإعادة التوجيه.",
3331+
returnToApp: "ارجع إلى {{appName}} للمتابعة. يمكنك إغلاق علامة التبويب هذه.",
3332+
returnToUnnamedApp: "ارجع إلى التطبيق للمتابعة. يمكنك إغلاق علامة التبويب هذه.",
3333+
openApp: "فتح {{appName}}",
3334+
openUnnamedApp: "فتح التطبيق",
33313335
failed: "فشلت الموافقة",
33323336
footer: "يمكنك إلغاء الوصول في أي وقت من إعدادات حسابك.",
33333337
},

‎ui/packages/i18n/src/locales/de.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3054,6 +3054,10 @@ const de = {
30543054
granted: "Zugriff gewährt",
30553055
denied: "Zugriff verweigert",
30563056
noRedirect: "Der Server hat keine Weiterleitungs-URL zurückgegeben.",
3057+
returnToApp: "Kehren Sie zu {{appName}} zurück, um fortzufahren. Sie können diesen Tab schließen.",
3058+
returnToUnnamedApp: "Kehren Sie zur Anwendung zurück, um fortzufahren. Sie können diesen Tab schließen.",
3059+
openApp: "{{appName}} öffnen",
3060+
openUnnamedApp: "Anwendung öffnen",
30573061
failed: "Zustimmung fehlgeschlagen",
30583062
footer: "Sie können den Zugriff jederzeit in Ihren Kontoeinstellungen widerrufen.",
30593063
},

‎ui/packages/i18n/src/locales/en.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3710,6 +3710,14 @@ const en = {
37103710
granted: 'Access granted',
37113711
denied: 'Access denied',
37123712
noRedirect: 'No redirect URL returned by the server.',
3713+
// Shown in place of the consent card after a decision whose redirect is
3714+
// not `http(s)` (a native app's custom scheme): the tab stays here while
3715+
// the operating system opens the app. `{{appName}}` is the registered
3716+
// name; the Unnamed forms are used when the client was not identified.
3717+
returnToApp: 'Return to {{appName}} to continue. You can close this tab.',
3718+
returnToUnnamedApp: 'Return to the application to continue. You can close this tab.',
3719+
openApp: 'Open {{appName}}',
3720+
openUnnamedApp: 'Open the application',
37133721
failed: 'Consent failed',
37143722
footer: 'You can revoke access at any time from your account settings.',
37153723
},

‎ui/packages/i18n/src/locales/es.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3124,6 +3124,10 @@ const es = {
31243124
granted: "Acceso concedido",
31253125
denied: "Acceso denegado",
31263126
noRedirect: "El servidor no devolvió ninguna URL de redirección.",
3127+
returnToApp: "Vuelva a {{appName}} para continuar. Puede cerrar esta pestaña.",
3128+
returnToUnnamedApp: "Vuelva a la aplicación para continuar. Puede cerrar esta pestaña.",
3129+
openApp: "Abrir {{appName}}",
3130+
openUnnamedApp: "Abrir la aplicación",
31273131
failed: "Error en el consentimiento",
31283132
footer: "Puede revocar el acceso en cualquier momento desde la configuración de su cuenta.",
31293133
},

‎ui/packages/i18n/src/locales/fr.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3120,6 +3120,10 @@ const fr = {
31203120
granted: "Accès accordé",
31213121
denied: "Accès refusé",
31223122
noRedirect: "Le serveur n'a renvoyé aucune URL de redirection.",
3123+
returnToApp: "Retournez dans {{appName}} pour continuer. Vous pouvez fermer cet onglet.",
3124+
returnToUnnamedApp: "Retournez dans l'application pour continuer. Vous pouvez fermer cet onglet.",
3125+
openApp: "Ouvrir {{appName}}",
3126+
openUnnamedApp: "Ouvrir l'application",
31233127
failed: "Échec du consentement",
31243128
footer: "Vous pouvez révoquer cet accès à tout moment dans les paramètres de votre compte.",
31253129
},

‎ui/packages/i18n/src/locales/ja.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3056,6 +3056,10 @@ const ja = {
30563056
granted: "アクセスを許可しました",
30573057
denied: "アクセスが拒否されました",
30583058
noRedirect: "サーバーからリダイレクト URL が返されませんでした。",
3059+
returnToApp: "{{appName}} に戻って続行してください。このタブは閉じてかまいません。",
3060+
returnToUnnamedApp: "アプリケーションに戻って続行してください。このタブは閉じてかまいません。",
3061+
openApp: "{{appName}} を開く",
3062+
openUnnamedApp: "アプリケーションを開く",
30593063
failed: "同意に失敗しました",
30603064
footer: "アクセス権はアカウント設定からいつでも取り消せます。",
30613065
},

‎ui/packages/i18n/src/locales/ko.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3054,6 +3054,10 @@ const ko = {
30543054
granted: "액세스가 허용되었습니다",
30553055
denied: "액세스 거부됨",
30563056
noRedirect: "서버가 리디렉션 URL을 반환하지 않았습니다.",
3057+
returnToApp: "{{appName}}(으)로 돌아가 계속하세요. 이 탭은 닫아도 됩니다.",
3058+
returnToUnnamedApp: "애플리케이션으로 돌아가 계속하세요. 이 탭은 닫아도 됩니다.",
3059+
openApp: "{{appName}} 열기",
3060+
openUnnamedApp: "애플리케이션 열기",
30573061
failed: "동의 실패",
30583062
footer: "계정 설정에서 언제든지 액세스를 취소할 수 있습니다.",
30593063
},

0 commit comments

Comments
 (0)