What could be the culprit?
# support-questions
w
What could be the culprit?
Everything else works, like signin, protected api routes etc
r
Hmmm
Can you enable debug logging on the backend and show the logs for the refresh API?
w
I delete the access token cookie and try an api route, after I get a 401, my refresh token and other cookies get deleted
Sure, let me do that
This is the relevant part
r
right. So it's possible that nginx is not forwarding the refresh token cookie to the server?
w
The client gets the refresh token for sure, I am not sure if it gets back to server
But after the 401, all of my cookies get deleted
r
can i see the request headers being sent from the browser?
when the refresh API call is made
w
Mm yea
r
hmm the refresh token is missing
w
sIdrefresh is there but the token is not
Weird
r
can you logout, login and try again?
maybe you manually deleted the refresh token as well by mistake
w
Same outcome
r
can i see the response headers in the login API?
w
I just deleted the access token
Sure
r
so the refresh token is being sent
i mean the client is getting it
w
Yes, its there
r
the path that it will be sent to is
/api/auth/session/refresh
does that match the refresh API path? When that API is being called?
w
Yes
Well actually, to /backend/api/auth/session/refresh
But that /backend part is the nginx proxy
r
right.. so that's the issue
w
The login, signout also goes thru that
r
whats the apiBasePath that you have set on the frontend?
w
/backend/api/auth
r
and on the backend?
w
base path is /api/auth and api domain is
APIDomain:     "https://localhost/backend"
Ahhh
Let me try localhost as the domain and backend/api as the path
Now I just get 404s, login stopped working too
I will try frontend domain with localhost/backend
I guess that may work
r
actually, the apiBasePath should be /api/auth, but add another config called apiGatewayPath which should be
/backend
w
For frontend or backend?
r
backend
w
This is also kinda weird, let me show you this
Now I set apiDomain: "https://localhost/backend", on frontend and the basePath is /api/auth
But the sdk is making requests to localhost/api/... instead
It makes sense if it only accepts domains without paths
Trying this now
It worked! ❤️
r
ok great!
w
Sorry for bruteforcing the solution
Did not see the apigateway in the guides but I shouldve just checked the struct in the SDK
Thanks a lot ❤️
2 Views