fix logout

This commit is contained in:
Aaron William Po
2023-02-13 16:15:10 -05:00
parent 7240cb0792
commit 249bfdaf5a
6 changed files with 16 additions and 25 deletions

View File

@@ -9,6 +9,9 @@ const useUser = () => {
error,
isLoading,
} = useSWR('/api/users/current', async (url) => {
if (!document.cookie.includes('token')) {
return null;
}
const response = await fetch(url);
if (!response.ok) {