yo-next-auth/hooks/useCurrentUser.ts

7 lines
145 B
TypeScript

import { useSession } from 'next-auth/react'
export const useCurrentUser = () => {
const session = useSession()
return session.data?.user
}