From db589ead041990ff36459a7fcd8f343941826fe8 Mon Sep 17 00:00:00 2001 From: iMercy Date: Wed, 3 Dec 2025 00:46:56 -0700 Subject: [PATCH 1/2] fix: Reset data upon login --- composables/useAuth.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/composables/useAuth.ts b/composables/useAuth.ts index f689c6f..1bba193 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,11 @@ 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', From 5859a74d42307d5953dd29b7358c730037debe09 Mon Sep 17 00:00:00 2001 From: iMercy Date: Fri, 5 Dec 2025 13:20:49 -0700 Subject: [PATCH 2/2] fix: Format issue resolved --- composables/useAuth.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composables/useAuth.ts b/composables/useAuth.ts index 1bba193..a0a2e09 100644 --- a/composables/useAuth.ts +++ b/composables/useAuth.ts @@ -1,4 +1,4 @@ -import { useDataManager } from "./useDataManager"; +import { useDataManager } from './useDataManager'; export const useAuth = () => { // Cookie management for persistence @@ -44,7 +44,6 @@ export const useAuth = () => { const { clearData } = useDataManager(); clearData(); - const api = useApi(); const response = await api('/login', { method: 'POST',