fix(portal): redirect unauthenticated users to login — never show portal chrome (GRO-309) #191

Merged
groombook-engineer[bot] merged 15 commits from fix/gro-309-landing-page-redirect into main 2026-04-01 03:50:40 +00:00
Showing only changes of commit 7443b66739 - Show all commits
+3 -6
View File
@@ -2,7 +2,6 @@ import { test, expect } from "./fixtures.js";
/**
* E2E tests for customer portal impersonation flow.
* Tests ImpersonationBanner display, actions, and session management.
*/
const MOCK_SESSION = {
@@ -19,7 +18,7 @@ const MOCK_SESSION = {
test.describe("ImpersonationBanner", () => {
test.beforeEach(async ({ page }) => {
// Impersonation session endpoints
// Only mock impersonation endpoints - portal/me is NOT called in impersonation flow
await page.route("**/api/impersonation/sessions/session-1", (route) =>
route.fulfill({ json: MOCK_SESSION })
);
@@ -32,10 +31,8 @@ test.describe("ImpersonationBanner", () => {
await page.route("**/api/impersonation/sessions/session-1/audit-log", (route) =>
route.fulfill({ json: { logs: [] } })
);
// Portal profile endpoint used during impersonation
await page.route("**/api/portal/me**", (route) =>
route.fulfill({ json: { id: "client-1", name: "Carol Client", email: "carol@test.com" } })
);
// NOTE: NOT mocking portal/me - this endpoint is only called in the CLIENT
// dev user flow (devUser.type === "client"), NOT in the impersonation flow
});
test("banner displays when session is active", async ({ page }) => {