Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
matborowczyk committed Feb 13, 2025
1 parent 7ebcfc1 commit 8d418f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Data/Auth/Providers/DatabaseAuthProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ export const DatabaseAuthProvider: React.FC<React.PropsWithChildren> = ({
// If user is not set and token is present, set the user from the local storage or logs out. case where there is an user but not token is handled automatically as lacks of token prompt use to login again
if (!user && getToken()) {
const username = localStorage.getItem("inmanta_user");

if (username) {
setUser(username);
} else {
logout();
}
}
}, [user]);
}, [user, logout]);

return (
<AuthContext.Provider
Expand Down

0 comments on commit 8d418f6

Please sign in to comment.