Hey, I have a sveltekit frontend and nestjs backe...
# support-questions-legacy
a
Hey, I have a sveltekit frontend and nestjs backend and I have figured out how to use supertokens on nesjs and sveltekit client side, but I don't know how to authorise on the server side and also how can I make API calls to my nestjs backend from server side in sveltekit, for ex in load function?
r
Hey @Akash Raju M
a
Hey
r
You can use the getSession Function when doing server side rendering. Checkout the NextJS docs -> session verification -> getServerSideProps. (I know you are not using NextJS, but something similar would apply here)
a
Thanks, I'll check it.
Will I be able to call my nestjs backend using this?
r
Yes. That’s more in the realm of machine to machine
a
Yes, that's the part I'm confused about
Can I get cookies from req and forward them?
I would like to avoid changing auth implementation on nestjs side if possible.
r
Yes. You can get cookies and forward them. Does the nestjs side use supertokens session as well?
a
@rp_st Yes, I followed the guide on the supertokens website.
Would it cause any issues?
r
Not really. The only thing you have to be careful about is that the nestjs backend sending a 401. That needs to be propagated to the frontend.
a
Okay thanks
11 Views