From f29f0bfbe637545578fe7a90ecefb8c7d6794c7b Mon Sep 17 00:00:00 2001 From: Natalie Bridgers Date: Mon, 28 Sep 2026 14:08:15 -0500 Subject: [PATCH] test: allow oauth retry after consent --- js/e2e-web/flows/05-oauth-login.spec.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/e2e-web/flows/05-oauth-login.spec.ts b/js/e2e-web/flows/05-oauth-login.spec.ts index c99bc4444..d52dc07b2 100644 --- a/js/e2e-web/flows/05-oauth-login.spec.ts +++ b/js/e2e-web/flows/05-oauth-login.spec.ts @@ -39,7 +39,14 @@ test("05-oauth-login: log in through the PDS, then chat", async ({ page }) => { await password.fill(PASSWORD!); await page.getByRole("button", { name: /^(sign in|next)$/i }).click(); - await page.getByRole("button", { name: /^authorize$/i }).click(); + // The PDS can skip consent on a retry after this OAuth client is already + // authorized, redirecting straight back to the app. + await Promise.race([ + page.getByRole("button", { name: /^authorize$/i }).click({ + timeout: 60_000, + }), + page.waitForURL((u) => u.origin === appOrigin, { timeout: 60_000 }), + ]); // back through the node's /oauth/return to the app's /login, which lands a // logged-in user on their account settings -- knotmirror 0.0.1