Browser gate: the guest's sign-in through the smart door
call.mjs's signInAsGuest posted the old door's form (form[rst-form]) and waited for exactly /signin?sent=1. The door is rastrillo's screen now: its form is form[rst-signin-form], and Sent is /signin?sent=1&attempt=<id>. It now also checks that the join cookie's door offers no Oficina ID. native-auth.mjs waits for Sent the same way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+13
−4
test/browser/call.mjs+11 −3test/browser/native-auth.mjs+2 −1
CI passed — run details
CI log
=== vet === go vet ./... go vet -tags browser ./internal/calls/ ./internal/callstest/ === fmt === === test === go test ./... ok amadan.net/oficina/calls/callscore (cached) ok amadan.net/oficina/calls/cmd/calls (cached) ? amadan.net/oficina/calls/cmd/calls-contract [no test files] ok amadan.net/oficina/calls/cmd/quality-summary (cached) ? amadan.net/oficina/calls/gen [no test files] ok amadan.net/oficina/calls/gen/locales (cached) ok amadan.net/oficina/calls/internal/calls 13.937s ok amadan.net/oficina/calls/internal/calls/apns (cached) ok amadan.net/oficina/calls/internal/calls/hub (cached) ? amadan.net/oficina/calls/internal/calls/icons [no test files] ? amadan.net/oficina/calls/internal/calls/keymailtest [no test files] ok amadan.net/oficina/calls/internal/calls/relay (cached) ok amadan.net/oficina/calls/internal/calls/seal (cached) ? amadan.net/oficina/calls/internal/calls/teamstate [no test files] ok amadan.net/oficina/calls/internal/callstest 12.354s ok amadan.net/oficina/calls/protocol (cached) ? amadan.net/oficina/calls/scripts/writeestilo [no test files] === migration-check === go run amadan.net/rastrillo/rastrillo/cmd/rastrillo migration check rastrillo migration check: models and migrations agree === race === CGO_ENABLED=1 go test -race ./internal/... ok amadan.net/oficina/calls/internal/calls 104.555s ok amadan.net/oficina/calls/internal/calls/apns (cached) ok amadan.net/oficina/calls/internal/calls/hub (cached) ? amadan.net/oficina/calls/internal/calls/icons [no test files] ? amadan.net/oficina/calls/internal/calls/keymailtest [no test files] ok amadan.net/oficina/calls/internal/calls/relay (cached) ok amadan.net/oficina/calls/internal/calls/seal (cached) ? amadan.net/oficina/calls/internal/calls/teamstate [no test files] ok amadan.net/oficina/calls/internal/callstest 48.294s
Intent
diff --git a/test/browser/call.mjs b/test/browser/call.mjs| index 45396d6..851278b 100644 |
| --- a/test/browser/call.mjs |
| +++ b/test/browser/call.mjs |
| @@ -1169,12 +1169,20 @@ async function signInAsGuest(ctx, address = GUEST) { |
| check(page.url().startsWith(origin + '/signin'), |
| 'the link sends a signed-out outsider to sign in (at ' + where(page) + ')'); |
| + // The smart door's email way (rastrillo's screen in estilo's door): |
| + // the join cookie's door is the email field alone, never Oficina ID. |
| + check(await page.locator('a[href^="/signin/oficina"]').count() === 0, |
| + 'the join cookie\'s door offers no Oficina ID (at ' + where(page) + ')'); |
| await page.fill('input[name="address"]', address); |
| + // Sent is /signin?sent=1&attempt=<id>: the attempt names the address on |
| + // the page and differs every time, the same shape for anybody. |
| + const sent = (u) => u.pathname === '/signin' && u.searchParams.get('sent') === '1' && u.searchParams.has('attempt'); |
| await Promise.all([ |
| - page.waitForURL('**/signin?sent=1', { timeout: 15000 }), |
| - page.click('form[rst-form] button[type="submit"]'), |
| + page.waitForURL(sent, { timeout: 15000 }), |
| + page.click('form[rst-signin-form] button[type="submit"]'), |
| ]); |
| - check(page.url() === origin + '/signin?sent=1', |
| + const at = new URL(page.url()); |
| + check(sent(at) && [...at.searchParams.keys()].sort().join(',') === 'attempt,sent', |
| 'asking for a sign-in link gives the same answer every time (at ' + where(page) + ')'); |
| const link = await control('guest-link ' + address); |
diff --git a/test/browser/native-auth.mjs b/test/browser/native-auth.mjs| index 9b516f9..2becf20 100644 |
| --- a/test/browser/native-auth.mjs |
| +++ b/test/browser/native-auth.mjs |
| @@ -26,7 +26,8 @@ try { |
| } |
| await address.fill(config.address); |
| await Promise.all([ |
| - page.waitForURL('**/signin?sent=1'), |
| + // Sent is /signin?sent=1&attempt=<id> since the smart door. |
| + page.waitForURL((u) => u.pathname === '/signin' && u.searchParams.get('sent') === '1'), |
| page.locator('form[action="/signin"] button[type="submit"]').click(), |
| ]); |
| process.stdout.write('mail\n'); |