♻️ Redirect the user to login if we get 401/403 (#1501)
This commit is contained in:
@@ -115,3 +115,13 @@ test("Logged-out user cannot access protected routes", async ({ page }) => {
|
||||
await page.goto("/settings")
|
||||
await page.waitForURL("/login")
|
||||
})
|
||||
|
||||
test("Redirects to /login when token is wrong", async ({ page }) => {
|
||||
await page.goto("/settings")
|
||||
await page.evaluate(() => {
|
||||
localStorage.setItem("access_token", "invalid_token")
|
||||
})
|
||||
await page.goto("/settings")
|
||||
await page.waitForURL("/login")
|
||||
await expect(page).toHaveURL("/login")
|
||||
})
|
Reference in New Issue
Block a user