Skip to content

Commit 34b7a67

Browse files
committed
fix: logout & login page home button
1 parent e06e9db commit 34b7a67

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/components/header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default function Header() {
5555
<NavigationMenuList>
5656
<Card className="mr-1">
5757
<NavigationMenuLink asChild className={navigationMenuTriggerStyle() + ' !text-foreground'}>
58-
<Link to="/dashboard"><img className="h-7 mr-1" src='/dashboard/logo.svg' /> NEZHA</Link>
58+
<Link to={profile ? "/dashboard" : '#'}><img className="h-7 mr-1" src='/dashboard/logo.svg' /> NEZHA</Link>
5959
</NavigationMenuLink>
6060
</Card>
6161

src/hooks/useAuth.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export const AuthProvider = ({ children }: {
4242
};
4343

4444
const logout = () => {
45+
document.cookie.split(";").forEach(function (c) { document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/"); });
4546
setProfile(undefined);
4647
navigate("/dashboard/login", { replace: true });
4748
};

0 commit comments

Comments
 (0)