Hey. Is there a way to get info about user session...
# support-questions-legacy
m
Hey. Is there a way to get info about user session in the Nextjs 13 server component ? With
getServerSideProps
it was like this:
Copy code
await getSession(req, res, {
  overrideGlobalClaimValidators: () => []
})
Since
req
and
res
props are no longer available in server side functions, I wonder if it's possible to get needed info from
headers()
?
r
Hey @mopixels
We will be checking out next13 integration in the coming weeks. I’ll let you know then.
But, at the moment the getSession function requires req / res
You could make your own req / res object that’s conform with the BaseRequest and BaseResponse interface (from our backend SDK)
And pass that in
And those object would read from the header()
m
Thanks for the response. Building a
req
and
res
object is quit a hassle 😕 Probably will go with session verification in api route until you guys release integration with next13, unless you have some boiler plate for building res and req objects 😃
r
Makes sense.