Remove refreshToken navigation side effects and let callers handle redirects
Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
@@ -261,13 +261,13 @@ describe("loginStore", () => {
|
||||
cookieSetter.mockRestore();
|
||||
});
|
||||
|
||||
it("redirects to login and re-throws on failure", async () => {
|
||||
it("re-throws on failure without performing navigation", async () => {
|
||||
document.cookie = "luciaRefreshToken=old-refresh-token";
|
||||
axios.post.mockRejectedValue(new Error("401"));
|
||||
|
||||
await expect(store.refreshToken()).rejects.toThrow("401");
|
||||
|
||||
expect(store.$router.push).toHaveBeenCalledWith("/login");
|
||||
expect(store.$router.push).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user