fix: retain masterkey on non-logout error scenarios and refresh on db hit miss

This commit is contained in:
ramvignesh-b
2026-04-15 16:57:03 +05:30
parent ef545e9e2b
commit fd64578a17
4 changed files with 89 additions and 16 deletions
+2 -2
View File
@@ -191,7 +191,7 @@ describe("initialize", () => {
expect(useKeyStore.getState().masterKey).not.toBeNull();
});
it("should clear both stores if the refresh attempt fails", async () => {
it("should preserve the master key even if the refresh attempt fails", async () => {
server.use(
http.post(
`${API_URL}/api/auth/refresh/`,
@@ -206,6 +206,6 @@ describe("initialize", () => {
expect(useAuthStore.getState().accessToken).toBeNull();
expect(useAuthStore.getState().user).toBeNull();
expect(useKeyStore.getState().masterKey).toBeNull();
expect(useKeyStore.getState().masterKey).not.toBeNull();
});
});