https://supertokens.com/ logo
With next13
m

mopixels

02/10/2023, 7:17 PM
Hey. Is there a way to get info about user session in the Nextjs 13 server component ? With
getServerSideProps
it was like this:
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

rp

02/11/2023, 4:38 AM
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

mopixels

02/13/2023, 9:47 AM
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

rp

02/13/2023, 10:14 AM
Makes sense.