Files
reflector/www/app/lib/useUserName.ts
Igor Loskutov 31c44ac0bb fix auth
2025-09-02 14:44:10 -04:00

8 lines
225 B
TypeScript

import { useAuth } from "./AuthProvider";
export const useUserName = (): string | null | undefined => {
const auth = useAuth();
if (auth.status !== "authenticated") return undefined;
return auth.user?.name || null;
};