cambridge-cares / TheWorldAvatar

A knowledge-graph-based digital twin of the world.
https://theworldavatar.io/
MIT License
87 stars 25 forks source link

Authenticated based UI components #1337

Closed Ushcode closed 2 months ago

Ushcode commented 2 months ago

restore stuff like


    useEffect(() => {
    const fetchRoles = async () => {
      try {
        const { roles } = await (await fetch('/api/userinfo')).json() as { roles: Roles };
        setRoles(roles);
      } catch (error) {
        console.error('Error fetching user Info', error);
      }
    };

    fetchRoles();
  }, []);