diff --git a/composables/useAuth.ts b/composables/useAuth.ts index f689c6f..a0a2e09 100644 --- a/composables/useAuth.ts +++ b/composables/useAuth.ts @@ -1,3 +1,5 @@ +import { useDataManager } from './useDataManager'; + export const useAuth = () => { // Cookie management for persistence const userCookie = useCookie('auth.user', { @@ -38,6 +40,10 @@ export const useAuth = () => { const login = async (credentials: { email: string; password: string }) => { try { + //clear data before new login + const { clearData } = useDataManager(); + clearData(); + const api = useApi(); const response = await api('/login', { method: 'POST',