next-auth 中 useSession 和 getSession 的区别?

Difference between useSession and getSession in next-auth?

useSessionnext-auth中的getSession有什么区别?两者似乎都在返回 session 对象。

useSession ReactJS 挂钩仅适用于客户端,returns 声明可帮助您更新 UI 并且它是在 getSession[=13= 之上制作的]

getSession thenable 函数(returns 承诺)读取当前 cookie 和 returns 会话,在客户端和服务器上都有效