feat: logout
This commit is contained in:
parent
295f3ecd14
commit
015f401a70
1 changed files with 5 additions and 3 deletions
|
@ -2,10 +2,12 @@ import { useAuthStore } from "../../store/auth";
|
|||
|
||||
function Logout() {
|
||||
const auth = useAuthStore();
|
||||
auth.clearToken();
|
||||
|
||||
if (auth.token !== null)
|
||||
auth.clearToken();
|
||||
|
||||
document.location.href = "/";
|
||||
return <></>;
|
||||
|
||||
return <>Redirecting...</>;
|
||||
}
|
||||
|
||||
export default Logout;
|
||||
|
|
Loading…
Reference in a new issue