Skip to content

Commit 17c5dff

Browse files
Update src/components/Navbar.tsx
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 447a690 commit 17c5dff

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/components/Navbar.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ const Navbar: React.FC = () => {
4141

4242
const handleLogout = () => {
4343
localStorage.removeItem("token");
44+
localStorage.removeItem("user");
4445
setIsAuthed(false);
46+
setUser(null);
47+
// notify same-tab listeners
48+
window.dispatchEvent(new Event("authChange"));
4549
navigate("/login");
4650
};
4751

0 commit comments

Comments
 (0)