forked from phoenix/litellm-mirror
ui - clear cookies on logout
This commit is contained in:
parent
4b8a5ceee3
commit
60ba879061
1 changed files with 7 additions and 6 deletions
|
@ -57,6 +57,11 @@ const Navbar: React.FC<NavbarProps> = ({
|
|||
|
||||
console.log("logoutUrl=", logoutUrl);
|
||||
|
||||
const handleLogout = () => {
|
||||
// Clear cookies
|
||||
document.cookie = "token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
|
||||
window.location.href = logoutUrl;
|
||||
}
|
||||
|
||||
|
||||
const items: MenuProps["items"] = [
|
||||
|
@ -72,11 +77,7 @@ const Navbar: React.FC<NavbarProps> = ({
|
|||
},
|
||||
{
|
||||
key: "2",
|
||||
label: (
|
||||
<a href={logoutUrl}>
|
||||
<p>Logout</p>
|
||||
</a>
|
||||
),
|
||||
label: <p onClick={handleLogout}>Logout</p>,
|
||||
}
|
||||
];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue