"use client"; import { Spinner, Link } from "@chakra-ui/react"; import { useAuth } from "../lib/AuthProvider"; export default function UserInfo() { const auth = useAuth(); const status = auth.status; const isLoading = status === "loading"; const isAuthenticated = status === "authenticated"; const isRefreshing = status === "refreshing"; return isLoading ? ( ) : !isAuthenticated && !isRefreshing ? ( { e.preventDefault(); auth.signIn("authentik"); }} > Log in ) : ( auth.signOut({ callbackUrl: "/" })} > Log out ); }