https://supertokens.com/ logo
Title
r

Ressiject

10/14/2022, 4:41 PM
Unauthorized fetch with server side rendering, (implement front end server side rendering), Next.js and Axios
r

rp

10/15/2022, 4:08 AM
Hey @Ressiject
Is your api domain and website domain different? What are the values?
r

Ressiject

10/16/2022, 2:00 AM
yes
client will access at localhost:3000
0
while we are trying to implement front-end with server side rendering
should i try to handle with user cache ?
i mean we are treat api as gate way where front-end only ask for resource
r

rp

10/16/2022, 5:06 AM
I see. So the cookies are not being sent to localhost:3000? (During server side rendering)
r

Ressiject

10/16/2022, 1:17 PM
yes
r

rp

10/16/2022, 1:18 PM
Do the cookies get sent to the api gateway?
r

Ressiject

10/16/2022, 1:18 PM
nope
r

rp

10/16/2022, 1:19 PM
whats the value of apiDomain and websiteDomain that you have set in the appInfo? Also, can i see the set-cookie header response when you call the sign in API (screenshot from chrome will do)
r

Ressiject

10/16/2022, 1:20 PM
8000 for api, 3000 for website
my solution now is use cookie and send
XD
r

rp

10/16/2022, 1:21 PM
what do you mean?
r

Ressiject

10/16/2022, 1:21 PM
i mean i write front-end
by read cookie from user computer
and send to website domain
r

rp

10/16/2022, 1:23 PM
i don't think i undersatnd
r

Ressiject

10/16/2022, 1:24 PM
i mean the problem here
not when we send request from front-end to back-end
i mean
it look like comunication between client and server (in front end)
its didn't send cookies from user computer to front-end
r

rp

10/16/2022, 1:27 PM
so if the cookies are attached to localhost:8000, they should also be sent to webserver on localhost:3000 when you navigate to the site from the browser.
r

Ressiject

10/16/2022, 1:27 PM
oh i see
then why should i track the cookie
it look like some bug here
r

rp

10/16/2022, 1:29 PM
what do you mean why should you track cookies.
r

Ressiject

10/16/2022, 1:29 PM
i mean
i write that part myself
r

rp

10/16/2022, 1:29 PM
you don't need to. Just use our SDKs 🙂
r

Ressiject

10/16/2022, 1:29 PM
thanks
it a little bit confuse
because it work before
r

rp

10/16/2022, 1:30 PM
hmm
maybe see what you changed and try and debug
r

Ressiject

10/16/2022, 1:31 PM
ok thank you 🙂
it problem in my team XD
they ask me to ask you
r

rp

10/16/2022, 1:31 PM
hmm ok
haha.. if you can't figure out the issue, maybe try seeing one of our example apps
r

Ressiject

10/16/2022, 1:33 PM
we looked before
thank you
next.js is a little bit different
r

rp

10/16/2022, 1:36 PM
we have a nextjs example app as well
try it with
npx create-supertokens-app
command