Retrieves information about the currently authenticated user.
The current user or null if not available.
const currentUser = useCurrentUser()if (currentUser) { console.log('Logged in as', currentUser.name) const department = currentUser.attributes?.find((attr) => attr.key === 'department')} Copy
const currentUser = useCurrentUser()if (currentUser) { console.log('Logged in as', currentUser.name) const department = currentUser.attributes?.find((attr) => attr.key === 'department')}
Retrieves information about the currently authenticated user.