Update useUser.ts

Fixed issue where the current user was not being added to UserContext
This commit is contained in:
Aaron William Po
2023-02-13 19:27:36 -05:00
parent 07dca6b4c2
commit 5561f209e9

View File

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