use authenticated status

This commit is contained in:
Karol Wypchlo 2021-04-08 14:06:22 +02:00
parent 63efcc4b37
commit df0a0f22b8
2 changed files with 4 additions and 2 deletions

View File

@ -28,7 +28,7 @@ const Navigation = ({ mode, uri }) => {
const [open, setOpen] = React.useState(false);
const windowSize = useWindowSize();
const isWindowTop = useWindowTop();
const { authenticated } = useAuthenticatedStatus();
const { data: authenticated } = useAuthenticatedStatus();
console.log(authenticated);

View File

@ -1,5 +1,7 @@
import useSWR from "swr";
const fetcher = (url) => fetch(url).then((response) => response.json());
export default function useAuthenticatedStatus() {
return useSWR("/__internal/do/not/use/authenticated", (url) => fetch(url).then((response) => response.json()));
return useSWR("/__internal/do/not/use/authenticated", fetcher);
}