refactor(old app): login migration to new app

This commit is contained in:
2025-10-21 20:22:21 -05:00
parent a2a8e0ef9f
commit eb3fa4dd52
28 changed files with 2273 additions and 2140 deletions

View File

@@ -1,16 +1,19 @@
import {useSessionStore} from "@/lib/store/sessionStore";
import {useRouter} from "@tanstack/react-router";
import { useRouter } from "@tanstack/react-router";
import { useSessionStore } from "@/lib/store/sessionStore";
import { useAuthStore } from "@/lib/store/useAuthStore";
export const useLogout = () => {
const {clearSession} = useSessionStore();
const router = useRouter();
const logout = async () => {
router.invalidate();
router.clearCache();
clearSession();
const { clearSession } = useSessionStore();
const { clearUser } = useAuthStore();
const router = useRouter();
const logout = async () => {
router.invalidate();
router.clearCache();
clearSession();
clearUser();
window.location.reload();
};
window.location.reload();
};
return logout;
return logout;
};