mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 22:27:16 +01:00
Updated edit permissions on settings components.
This commit is contained in:
parent
ffc8f6faae
commit
7effa16f00
15 changed files with 128 additions and 148 deletions
|
|
@ -8,23 +8,18 @@ import { removeClientAuthToken } from '@/lib/client';
|
|||
export function LogoutPage() {
|
||||
const router = useRouter();
|
||||
const { post } = useApi();
|
||||
const disabled = process.env.cloudUrl;
|
||||
|
||||
useEffect(() => {
|
||||
async function logout() {
|
||||
await post('/auth/logout');
|
||||
}
|
||||
|
||||
if (!disabled) {
|
||||
removeClientAuthToken();
|
||||
|
||||
logout();
|
||||
|
||||
router.push('/login');
|
||||
|
||||
return () => setUser(null);
|
||||
}
|
||||
}, [disabled, router, post]);
|
||||
|
||||
removeClientAuthToken();
|
||||
setUser(null);
|
||||
logout();
|
||||
}, [router, post]);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue