fix(e2e): treat /login/* as still IN the login flow #105

Merged
nrupard merged 1 commit from fix/e2e-login-pathname-anchor into main 2026-06-05 18:29:31 +02:00
Owner

Summary

The CI diagnostic dump from PR #104 revealed the staging E2E account has 2FA enabled. The bunyip hub redirects to /login/2fa after the first credentials submit. The previous loginViaSpa URL-leaving check used /^\/login\/?$/, which only anchored against /login exactly - so /login/2fa slipped through as "URL has left /login" and the helper returned success while the user was actually mid-flow. The setup test then burned another 30s looking for a bearer no successful sign-in had minted.

Widen the regex to /^\/login(\/|$)/ so any path under /login (2fa, mfa, recovery, etc) counts as IN the login flow. The poll keeps waiting and times out cleanly with a clearer message when the flow stalls.

Does NOT fix the underlying 2FA issue - the E2E account either needs 2FA disabled or the test needs to enter a TOTP code (separate decision still pending). This just makes the failure mode "login never completed" rather than "login completed, no API call", so the next iteration is faster.

Test plan

  • Post-merge run: if 2FA is still enabled on the E2E account, the test fails fast at "SPA login never navigated away from the /login flow" instead of running the full 30s bearer-poll dance.
## Summary The CI diagnostic dump from PR #104 revealed the staging E2E account has 2FA enabled. The bunyip hub redirects to `/login/2fa` after the first credentials submit. The previous `loginViaSpa` URL-leaving check used `/^\/login\/?$/`, which only anchored against `/login` exactly - so `/login/2fa` slipped through as "URL has left /login" and the helper returned success while the user was actually mid-flow. The setup test then burned another 30s looking for a bearer no successful sign-in had minted. Widen the regex to `/^\/login(\/|$)/` so any path under `/login` (2fa, mfa, recovery, etc) counts as IN the login flow. The poll keeps waiting and times out cleanly with a clearer message when the flow stalls. Does NOT fix the underlying 2FA issue - the E2E account either needs 2FA disabled or the test needs to enter a TOTP code (separate decision still pending). This just makes the failure mode "login never completed" rather than "login completed, no API call", so the next iteration is faster. ## Test plan - [ ] Post-merge run: if 2FA is still enabled on the E2E account, the test fails fast at "SPA login never navigated away from the /login flow" instead of running the full 30s bearer-poll dance.
fix(e2e): treat /login/* (e.g. /login/2fa) as still IN the login flow
All checks were successful
Check / fmt + clippy + compile + tests (pull_request) Successful in 1m55s
Create release / Create release from merged PR (pull_request) Has been skipped
88c274b6c8
CI diagnostic dump revealed the staging E2E account has 2FA enabled. The bunyip hub redirects to `/login/2fa` after the first credentials submit. The old `loginViaSpa` URL-leaving check used \`/^\\/login\\/?$/\`, which only anchored against `/login` or `/login/` exactly - so `/login/2fa` slipped through as "URL has left /login" and the helper returned successful while the user was actually mid-flow.

Widen the regex to `/^\\/login(\\/|$)/` so any path under `/login` (2fa, mfa, recovery, etc) counts as IN the login flow. The poll keeps waiting and times out cleanly with a clearer message when the flow stalls, instead of returning false success and burning another 30s downstream looking for a bearer that no successful sign-in ever minted.

Does not fix the underlying 2FA issue (the E2E account needs 2FA disabled or the test needs to enter a TOTP code), but does mean the failure mode is now "login never completed" rather than "login completed but no API call". Faster to diagnose next time.

#PMS-140
nrupard deleted branch fix/e2e-login-pathname-anchor 2026-06-05 18:29:31 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-server!105
No description provided.