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() {
|
function Logout() {
|
||||||
const auth = useAuthStore();
|
const auth = useAuthStore();
|
||||||
|
if (auth.token !== null)
|
||||||
auth.clearToken();
|
auth.clearToken();
|
||||||
|
|
||||||
document.location.href = "/";
|
document.location.href = "/";
|
||||||
return <></>;
|
|
||||||
|
return <>Redirecting...</>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Logout;
|
export default Logout;
|
||||||
|
|
Loading…
Reference in a new issue