Reputation: 562
What's the difference between useSession
and getSession
in next-auth
? Both seems to be returning session
object.
Upvotes: 13
Views: 8916
Reputation: 2165
useSession
ReactJS hook that works only on client, that returns states which helps you to update UI and it's made on top of getSession
getSession
async function that read current cookies and returns session, works both on Client and Server
Upvotes: 16