Clear refresh token cookie during logout to enforce full session termination
Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
@@ -106,6 +106,7 @@ export const useLoginStore = defineStore("loginStore", {
|
|||||||
*/
|
*/
|
||||||
logOut() {
|
logOut() {
|
||||||
deleteCookie("luciaToken");
|
deleteCookie("luciaToken");
|
||||||
|
deleteCookie("luciaRefreshToken");
|
||||||
|
|
||||||
this.isLoggedIn = false;
|
this.isLoggedIn = false;
|
||||||
deleteCookie("isLuciaLoggedIn");
|
deleteCookie("isLuciaLoggedIn");
|
||||||
|
|||||||
@@ -163,6 +163,12 @@ describe("loginStore", () => {
|
|||||||
expect(store.isLoggedIn).toBe(false);
|
expect(store.isLoggedIn).toBe(false);
|
||||||
expect(store.$router.push).toHaveBeenCalledWith("/login");
|
expect(store.$router.push).toHaveBeenCalledWith("/login");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("clears refresh token cookie on logout", () => {
|
||||||
|
document.cookie = "luciaRefreshToken=refresh-token";
|
||||||
|
store.logOut();
|
||||||
|
expect(document.cookie).not.toContain("luciaRefreshToken=");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("getUserData", () => {
|
describe("getUserData", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user