Replies: 1 comment 1 reply
-
The object passed to getServerSideProps will never have session prop, Where did you see an example of the first code block usage? getSession isn't a hook, useSession is a hook. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been using the _app level Provider to pass sessions down to my components, and had some questions-
Within getServerSideProps, I took a look at the passed in props and saw that session is attached to the pageProps, such that I can do this in my pages:
Is this an acceptable way to pass sessions down, or should I still use the below await pattern?
I realize that getSession() is a hook, so I think it's not that big of a deal to call it repeatedly, but I can't tell if it's redundant with the global Provider there already.
Forgive me if this is a somewhat simple question - I'm rather new to a lot of this and the material is just foreign enough that I can't tell if I'm doing things wrong or not!
Feedback
Documentation refers to searching through online documentation, code comments and issue history. The example project refers to next-auth-example.
Beta Was this translation helpful? Give feedback.
All reactions