Skip to content

Commit 541297c

Browse files
committed
improvement: Ensure user state is cleared on sign out
1 parent 5d89e5d commit 541297c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/contexts/AuthContext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
5353
});
5454

5555
setUser(user);
56-
57-
console.log("user...", user);
56+
console.table(user);
5857

5958
Router.push("/dashboard");
6059
}
6160

6261
function signOut() {
6362
destroyCookie(undefined, "nextauth.token");
6463
Router.push("/auth/signin");
64+
setUser(null);
6565
}
6666

6767
return <AuthContext.Provider value={{ user, isAuthenticated, signIn, signOut }}>{children}</AuthContext.Provider>;

0 commit comments

Comments
 (0)