diff --git a/src/contexts/AuthContext.js b/src/contexts/AuthContext.js index 0483cb5..8aa4822 100644 --- a/src/contexts/AuthContext.js +++ b/src/contexts/AuthContext.js @@ -17,6 +17,9 @@ export const AuthProvider = ({ children }) => { }, []); const login = async (userId, password) => { + removeAuthToken(); + setCurrentUser(null); + try { const response = await authApi.login({ userId, password }); const { accessToken } = response.data.data;