fix(e2e): intercept SPA bearer for setup, click User-menu -> Logout #102
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/e2e-spa-bearer-intercept-and-logout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Two failures on the latest post-merge E2E run; both addressed here.
Failure 1 - setup project 401.
POST /api/v1/auth/loginreturnedUNAUTHORIZED. The OP (crates/mokosh-auth-oidc/src/discovery.rs:47) advertises onlyauthorization_code+refresh_tokengrants - noclient_credentials, no password grant - so a service-to-service token mint was never available. SPA accounts created via the bunyip hub do not exist in mokosh's localuserstable, so legacy/api/v1/auth/login401s for hub-signed-up accounts.Replace
loginViaApiwith a real-browser flow in setup: drive the SPA login, listen for any outbound/api/v1request, capture theAuthorization: Bearerheader off the first match. Same auth path the SPA uses; no new OIDC client; no parallel signup pipeline. Token is written toe2e/.auth/token.txtthe same way as before for theapiproject's customrequestfixture.Failure 2 - logout button not found. Logout lives inside the user-menu dropdown, not on the page surface (
mokosh-clients/src/components/layout.rs:386). Click the avatar button (aria-label="User menu"), then clickLogoutinside therole="menu"popup. The handler then redirects through the bunyip hub's/logout(cross-origin POST + Set-Cookie + redirect to hub/login), so the post-logout URL wait grows from 15s to 30s.Drop the now-unused
loginViaApihelper. Setup project'suse:block becomes browser-shaped (Desktop Chrome, SPAbaseURL) since it now needs aPage.Test plan
/loginwithin 30s).