feat: redirect to home after logout (header and account)
This commit is contained in:
parent
d296b7aa72
commit
af5b4afebf
@ -36,7 +36,7 @@ export function AccountPanel() {
|
||||
|
||||
async function logout() {
|
||||
await fetch(`${apiBase}/auth/logout`, { method: "POST", credentials: "include", headers: { "X-CSRF-Token": csrf } });
|
||||
window.location.assign("/login");
|
||||
window.location.assign("/");
|
||||
}
|
||||
|
||||
async function changePassword(event: FormEvent<HTMLFormElement>) {
|
||||
|
||||
@ -21,8 +21,8 @@ export function SiteHeader() {
|
||||
async function handleLogout() {
|
||||
try {
|
||||
await logout();
|
||||
setAuthed(false);
|
||||
setOpen(false);
|
||||
window.location.assign("/");
|
||||
return;
|
||||
} catch {
|
||||
window.location.href = "/login";
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user