feat(auth): sign out from the app header
The shell had no way to end a session on shared booth machines; the new button signs out and returns to the login page. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
@@ -55,6 +55,19 @@ test.describe("app shell", () => {
|
||||
);
|
||||
});
|
||||
|
||||
test("signs out and locks the shell again", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 1024, height: 768 });
|
||||
await signInAs(page, `e2e-signout-${Date.now()}@example.com`);
|
||||
|
||||
await page.goto(`${BASE}/home`);
|
||||
await page.getByRole("button", { name: "Sign out" }).click();
|
||||
await expect(page).toHaveURL(`${BASE}/login`);
|
||||
|
||||
// The session cookie is gone, so the guarded shell bounces back to login.
|
||||
await page.goto(`${BASE}/home`);
|
||||
await expect(page).toHaveURL(`${BASE}/login`);
|
||||
});
|
||||
|
||||
test("redirects unauthenticated users away from the shell", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 360, height: 780 });
|
||||
await page.goto(`${BASE}/schedule`);
|
||||
|
||||
Reference in New Issue
Block a user