From 97ee1289aa6bdbe71aeb7d29b23e0c33bae78ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Smoli=C5=84ski?= Date: Tue, 24 Nov 2026 00:38:01 +0100 Subject: [PATCH] Reference smoke test: send the site origin so the login cookie counts; test typing Co-Authored-By: Claude Fable 5.2 --- reference/e2e/smoke.spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/e2e/smoke.spec.ts b/reference/e2e/smoke.spec.ts index 6ca2330..7a00fcd 100644 --- a/reference/e2e/smoke.spec.ts +++ b/reference/e2e/smoke.spec.ts @@ -225,7 +225,9 @@ test('admin: sign in through 2FA, agency credit, panel link preview', async ({ p test('API: a staff password without the 2FA code opens nothing; with the code it does', async ({ playwright, baseURL }) => { const { E2E_ADMIN_EMAIL: email, E2E_ADMIN_PASSWORD: password, E2E_TOTP_SECRET: secret } = process.env test.skip(!email || !password || !secret, 'E2E_* test admin not configured') - const api = await playwright.request.newContext({ baseURL }) // its own cookie jar + // Its own cookie jar. Payload takes the login cookie only from the site's own origin (csrf), so say where we are: + // without `Origin` these requests would count as anonymous and prove nothing. + const api = await playwright.request.newContext({ baseURL, extraHTTPHeaders: { origin: baseURL! } }) const login = await api.post('/api/users/login', { data: { email, password } }) expect(login.status()).toBe(200)