remove hard reload
deploy to danak / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-07-03 17:16:22 +03:30
parent afc2701580
commit 70e71d7bdb
5 changed files with 77 additions and 25 deletions
+19
View File
@@ -0,0 +1,19 @@
import { create } from "zustand";
import { getToken, removeRefreshToken, removeToken } from "./func";
type SessionAuthStore = {
isAuthenticated: boolean;
setAuthenticated: (value: boolean) => void;
clearSession: () => void;
};
export const useSessionAuth = create<SessionAuthStore>((set) => ({
isAuthenticated: !!getToken(),
setAuthenticated: (value) => set({ isAuthenticated: value }),
clearSession: () => {
removeToken();
removeRefreshToken();
window.isRefreshTokenExpired = false;
set({ isAuthenticated: false });
},
}));