feat(beta): public spaces (#2473)

This commit is contained in:
Philip Okugbe
2026-09-05 11:52:10 +01:00
committed by GitHub
parent f4796c982e
commit 876f3da1b2
117 changed files with 7592 additions and 715 deletions
@@ -0,0 +1,14 @@
import { useQuery } from "@tanstack/react-query";
import { getMyInfo } from "@/features/user/services/user-service";
import { ICurrentUser } from "@/features/user/types/user.types";
/** Probes login state from public surfaces; the /docs 401 exemption keeps anonymous visitors off the login redirect. */
export function useAuthenticatedUser(enabled = true) {
return useQuery<ICurrentUser>({
queryKey: ["currentUser"],
queryFn: getMyInfo,
retry: false,
staleTime: 5 * 60 * 1000,
enabled,
});
}