umami/pages/logout.js
2020-09-30 22:34:16 -07:00

14 lines
302 B
JavaScript

import { useEffect } from 'react';
import { useRouter } from 'next/router';
export default function LogoutPage() {
const router = useRouter();
const { basePath } = router;
useEffect(() => {
fetch(`${basePath}/api/auth/logout`).then(() => router.push('/login'));
}, []);
return null;
}