Open djuelg opened 5 months ago
I see. The issue is that our implementation does not take into account different ports. You have two options:
shouldDoInterceptions
via a config prop which will be used instead of our default implementation.For the moment I just extended from SuperTokensInterceptorWrapper
to override shouldRunDioInterceptor
. But when I find the time, I'll look into creating a PR :)
You provide the possibility to have different backends for the api-endpoints and auth-endpoints, by configuring
sessionTokenBackendDomain
. In our environment the two systems run on the same domain, but on different ports.When you try to authenticate your Dio api-requests via
SuperTokensInterceptorWrapper
, the methodshouldRunDioInterceptor
will returnfalse
, when the ports differ, leaving the requests unauthenticated. The causing code is:In my example the two values would evaluate to:
SuperTokensUtils.getApiDomain(options.uri.toString())
->https://example.com:65000/
(which is the api-backend)SuperTokens.config.apiDomain)
->https://example.com:3000/
(which is the auth-backend)Using the following config:
This issue prevents the
sessionTokenBackendDomain
from being evaluated. Wouldn't it be sufficient to rely on the following check only?