Hey, I realized the auth cookie isn't sent on mobi...
# support-questions-legacy
i
Hey, I realized the auth cookie isn't sent on mobile browser (tested on ios Chrome & Safari) so I get
refreshSession: UNAUTHORISED because idRefreshToken from cookies is undefined
is there any workaround? i'm working on a responsive PWA with nestjs + graphql + React
r
hey! it should be working on mobile browsers. What are the apiDomain, websiteDomain and can you enable backend debug logs and show me all the output?
i
r
Can you send the backend logs when the process starts?
i
you mean the authentication process starts? here it is
it works from my desktop browser
r
what is the value of cookie same site?
i
not familiar with it, is that a response header?
r
so the logs you have sent previously are when the middleware is called
i want to see the logs for when the process starts
so i can see the cookie settings
i
by process start you mean server initialized?
r
yes
i
r
ok so cookieSameSite is none, which is correct. This would not work on safari since safari doesn't allow third party cookies, but it should work on chrome
the best way to solve this would be to proxy requests to the api domain such that it shares a common domain with the frontend. For example you could do
https://api.yoooz.io/
That being said, if you do not want to do that, then you can switch to using headers instead of cookies - we have an example app of how that can be done: https://github.com/supertokens/supertokens-auth-react/tree/master/examples/with-localstorage
i
do you mean that in order to make it work on Safari as well I should switch to using headers?
r
yea. You could do that, or else use a proxy domain as the apiDomain instead of the heroku link (which is what i would do)
so create a DNS entry like api.yoooz.io which points to the heroku domain, and then change apiDOmain oon frontend and backend to be api.yoooz.io. This should make cookies work properly everywhere
i
i will try that approach then 🙂 thank you for helping out!!
i know it's not related to Supertokens, but maybe you could help me out 😊 after adding the CNAME for api.yoooz.io i get ERR_CERT_COMMON_NAME_INVALID and don't understand why, since my certificate is for *.yoooz.io as well
r
im not entirely sure myself. Sorry
7 Views