mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-21 04:39:06 +00:00
fix auth
This commit is contained in:
7
www/app/lib/useUserName.ts
Normal file
7
www/app/lib/useUserName.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { useAuth } from "./AuthProvider";
|
||||
|
||||
export const useUserName = (): string | null | undefined => {
|
||||
const auth = useAuth();
|
||||
if (auth.status !== "authenticated") return undefined;
|
||||
return auth.user?.name || null;
|
||||
};
|
||||
Reference in New Issue
Block a user