I'm getting this weird issue with an instance of S...
# support-questions-legacy
z
I'm getting this weird issue with an instance of SuperTokens. The signinup endpoint, while succeeding with 200 and creating the user/session, it's not returning anything. Anyone have any recommendations for debugging? Discord, ThirdParty recipe. Fastify, NodeJS. I tested the exact version and setup on another Fastify API and it works just fine. It's only this instance.
Hmmm this is weird
r
Hmmm. What values have you set for the apiDomain and websiteDomain?
z
A mapped .local, I'm digging into the utils right now to see what
parsedURL
is coming back as. one moment
oh...it seems like it's not registering
.local
domains
Side-effects of the .dev gTLD I guess haha
For context, I'm using
.local
because I need to test multiple subdomains. Using a subdomain router for a single Vue application.
r
Right. So the websiteDomain has to be a proper domain
z
Maybe the solution is make this also account for
.local
domains?
r
If you want to share sessions across sub domains, you want set the config in session.init
I’m not quite sure what you are trying to do
z
It just seems like utils doesn't account for "fake" domains. Since the addition of .dev as a real TLD a lot of people it seems to have transitioned to using
.test
or
.local
as test domains on their local machines. I normally just use localhost but since I'm using subdomains I am using another entry in my hosts file, in this case just
hcc.local
. I haven't even gotten to the sharing session across subdomains or any of that yet because the signinup during the login process fails. It seems to be that it fails because it's not detecting my fake domain that's not localhost as a real domain or a localhost domain.
r
Ahh right. Okay
Hmmm
z
this works btw
r
You could use .com instead of using .local. Set the value in /etc/hosts on a Mac
z
Just added it locally and and the API works perfectly now
r
Hmm. This would also need to be done on the backend SDK
z
I can workaround it for now by just mimicking a website, but it would be useful to not have to.
May be worth adding?
Can't recall, is the backend SDK opensource?
r
Yea fair. If you open an issue with details, we can add it eventually
Yup
z
Where is the best place to open the issue? considering it would probably have to be added in every client SDK and backend SDK.
r
you can open it in the supertokens-website repo: https://github.com/supertokens/supertokens-website
though, im not sure when we will be able to work on it. But open to accept PRs
z
Interesting, just updated it to be
hcc-dev.com
as a test and it's still failing. Did a clean install node_modules to ensure it's the best. I'm going to start digging again
Ahh, different error completely. Related to something else. One QoL thing could be actually logging these errors instead of failing silently
r
whats the error?
z
It was just about the API domain and website domain being different and how I should enable a setting to support it
Easy fix, just use the API under the same domain.
Oh huh, so apparently supertokens-web-js doens't have webDomain or webBasePath so shared domains is just unusable.
Oh...it's STILL complaining about multitenancy???
yeah...screw the subdomains. It's only giving me headaches.
r
Shared sub domains does work. I’m not sure what you have tried and what the errors are.. so really difficult to help. Anyway, hope you figure it out 🙂
z
I was going off of this: https://supertokens.com/docs/thirdparty/common-customizations/sessions/share-sessions-across-sub-domains The issue is, I don't use React. So the example for Vue is already not accurate. However, the key
websiteDomain
doesn't exist in the web-js version. Even trying to hop swap in react library (which definitely fails) it always asks me to call
Multitenancy.init
.
r
You don’t need to set the websiteDomain
You need to set the session.init config as shown in the link
z
one moment, I'll show you what happens
I can't fully replicate it a the moment and I'm currently working my 9-5. I've made so many changes to the API cors, the front end, etc since then removing the subdomain. All I remember is every time I even tried to call the API it kept on complaining about requiring Multitenancy and needing multitenancy before it can even do anything.
r
not sure how i can help here without a concrete issue.. For sharing session across sub domains, you have to change the config in the session.init as shown in the docs
z
If I run into it again I'll try to find something more concrete with that particular issue. ty! ❤️
r
sounds good!
3 Views