Fix issues with basePath.

This commit is contained in:
Mike Cao 2020-11-09 21:01:53 -08:00
parent 1e8c1d0d18
commit 339cd21596
15 changed files with 66 additions and 51 deletions

View file

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