Skip to content

fix(site): fix redirection to login after logout/change password #6870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
prettier
  • Loading branch information
rodrimaia committed Mar 29, 2023
commit 68882bd4ca3a0effbd69d58dd429bcc22e3be5d7
4 changes: 3 additions & 1 deletion site/e2e/tests/logout.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ test("signing out redirects to login page", async ({ page, baseURL }) => {
await page.getByTestId("user-dropdown-trigger").click()
await page.getByRole("menuitem", { name: "Sign Out" }).click()

await expect(page.getByRole("heading", { name: "Sign in to Coder" })).toBeVisible()
await expect(
page.getByRole("heading", { name: "Sign in to Coder" }),
).toBeVisible()

expect(page.url()).toMatch(/\/login$/) // ensure we're on the login page with no query params
})
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const userSecuritySettingsMachine = createMachine(
}),
redirectToHome: () => {
window.location.href = location.origin
}
},
},
},
)