mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 18:26:20 +01:00
19 lines
406 B
JavaScript
19 lines
406 B
JavaScript
import { useEffect } from 'react';
|
|
import { useRouter } from 'next/router';
|
|
import { removeItem } from 'next-basics';
|
|
import { AUTH_TOKEN } from 'lib/constants';
|
|
import { setUser } from 'store/app';
|
|
|
|
export default function LogoutPage() {
|
|
const router = useRouter();
|
|
|
|
useEffect(() => {
|
|
removeItem(AUTH_TOKEN);
|
|
router.push('/login');
|
|
|
|
return () => setUser(null);
|
|
}, []);
|
|
|
|
return null;
|
|
}
|