diff --git a/e2e/fixtures.js b/e2e/fixtures.js index dd206af..fa34743 100644 --- a/e2e/fixtures.js +++ b/e2e/fixtures.js @@ -85,8 +85,7 @@ export async function onboard(page, who) { await expect(onboarding.or(ready)).toBeVisible({ timeout: 90_000 }); if (await onboarding.isVisible()) { - await page.getByTestId('onboarding-user-id').fill(`${who}@example.com`); - await page.getByTestId('onboarding-display-name').fill(who); + await page.getByTestId('onboarding-user-id').fill(who); await page.getByTestId('onboarding-submit').click(); } diff --git a/e2e/m0-shell.spec.js b/e2e/m0-shell.spec.js index 8224098..59981e7 100644 --- a/e2e/m0-shell.spec.js +++ b/e2e/m0-shell.spec.js @@ -64,11 +64,12 @@ test.describe('app shell', () => { await expect(alice.getByTestId('onboarding-create-warning')).toBeVisible({ timeout: 90_000 }); await expect(alice.getByTestId('recover-identity')).toBeVisible(); - // The other half of the same hazard, and the one nobody could guess from the - // screen: the first field becomes the WebAuthn handle, so two people picking - // the same name on one front-desk device means the second replaces the - // first. The hint carries that — tied to the input rather than floating near - // it, because a warning a screen reader never reaches is not a warning. + // The name field used to carry a second hazard: it became the WebAuthn + // handle, so two people picking the same name on one front-desk device meant + // the second replaced the first. The handle is random now, and the hint says + // the opposite — that the name is only a label and may be shared. Either + // way it has to reach a screen reader, so it stays tied to the input rather + // than floating near it. const hint = alice.getByTestId('onboarding-user-id-hint'); await expect(hint).toBeVisible(); diff --git a/e2e/m1-program.spec.js b/e2e/m1-program.spec.js index 8274937..d68d3f8 100644 --- a/e2e/m1-program.spec.js +++ b/e2e/m1-program.spec.js @@ -232,8 +232,7 @@ async function onboard(page) { await page.goto('/studio/'); await expect(page.getByTestId('onboarding')).toBeVisible(READY); - await page.getByTestId('onboarding-user-id').fill('alice@example.com'); - await page.getByTestId('onboarding-display-name').fill('Alice'); + await page.getByTestId('onboarding-user-id').fill('Alice'); await page.getByTestId('onboarding-submit').click(); await expect(page.getByTestId('studio-ready')).toBeVisible(READY); diff --git a/src/lib/components/StudioGate.svelte b/src/lib/components/StudioGate.svelte index 1ba43ce..6fbd592 100644 --- a/src/lib/components/StudioGate.svelte +++ b/src/lib/components/StudioGate.svelte @@ -19,8 +19,10 @@ let { children } = $props(); - let userId = $state(''); - let displayName = $state(''); + // WebAuthn takes an account name and a display name. Both are labels for the + // credential picker, neither identifies the passkey, so the screen asks once + // and gives the same answer to both. + let name = $state(''); onMount(async () => { try { @@ -33,7 +35,7 @@ async function create(/** @type {SubmitEvent} */ event) { event.preventDefault(); try { - await createIdentityAndBoot({ userId, displayName }); + await createIdentityAndBoot({ userId: name, displayName: name }); } catch { // surfaced through bootStore } @@ -69,22 +71,20 @@