mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
Update useUser.ts
Fixed issue where the current user was not being added to UserContext
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user