I am working currently on the multitenancy as subd...
# support-questions-legacy
s
I am working currently on the multitenancy as subdomain in my app and I am not getting the session when authorizing the role of the user it doesn't get pass the verifySession. Even though I am signed in correctly and I am using the prebuiltUI as well. I will attach the debug log and the signed network log
r
hey @Sekai whats the request header of the API call look like in which you get a 401?
s
r
whats the configured apiDomain on the frontend? and whats the URL you are sending the API request to in the above screenshot? Do those values match?
s
the apiDomain is http://example.com:3000 I made the localhost in an alias so that the subdomain works
the url for api request has a subdomain so like http://subdomain.example.com:3000
r
right. So thats why it's not working
s
Oh I see
how can I make it work?
s
ohh I needed to share the session
I thought this was for frontend only
that makes sense
hmm @rp_st I tried adding the sessionTokenFrontendDomain: ".example.com" in the frontendConfig and it is working since I was able to access example.com when I only logged into the subdomain.example.com but I still have the same issue do I need to work on configuring the accessTokenPayload talked about here?
r
not sure what you mean. Is the access token now being sent as a st-access-token header in the request headers (not in cookies)?
s
It's sending like this
r
still not intercepting
enable our frontend debug logs and show the output when you call this API please.
s
I think it's this
r
Yea. Copy and send
s
Is it suppose to do this?
also what do you mean by copy and send
r
Send the logs over in a file please
s
ohh
r
instead of setting sessionTokenFrontendDomain, set the sessionTokenBackendDomain to
.example.com
s
Ohh tyty I didn't see that in the docs
hmm that didn't work
it keeps on refreshing session
@rp_st I think I found the issue in that for the sign in when I check the network tab the url sends the sign in to example.com even though I signed into the subdomain.example.com so example.com has the access token in the cookie but subdomain.example.com doesn't
r
Are these your frontend domains or backend?
s
for the subdomain.example.com it's the frontend so in the url it says that but when I check the backend from the network tab it says example.com
r
Right. So you also need to set sessionTokenFrontendDomain
s
I did both but it still fails and now there is a infinite loop on refresh session
I fixed it
I think
I had to make the api domain for the frontend window.location.origin as well
r
Sounds good
13 Views