Hello guys, connecting react + nestjs + react native app, have an issue with auth via google, receiv...
e
Hello guys, connecting react + nestjs + react native app, have an issue with auth via google, receiving response and status ok from supertokens core, but in react native doesSessionExists returns false, what can be a problem here? using latest versions of packages and selfhosted supertokens core
r
hey @error404404404 the reason is most likely some misconfig. See this issue for what might be wrong: https://github.com/supertokens/supertokens-website/issues/68
e
@rp_st that's not my case as we use header based auth
r
Oh I mean the list has info about that too. You should see the list linked above
e
@rp_st well, now we get Error: SuperTokens core threw an error for a GET request to path: '/auth/recipe/multitenancy/tenant' with status code: 400 and message: AppId or tenantId not found => Tenant with the following connectionURIDomain, appId and tenant Id combination not found: (, public, auth) but we do not use multitenancy, any clarification on this?
r
hmm. Whats the URL you are using for the core?
i mean, the connection URi on the backend
e
@rp_st in local testing case it's http://localhost:3567
r
and the local core is logging that error? " Tenant with the following connectionURIDomain, appId and tenant Id combination not found: (, public, auth)" ?
e
Well, basically what we do now is I do run core and backend locally and transfer backend via ngrok to my colleague who runs react native app
r
so the core is seeing the request from
http://localhost:3567/auth/...
which equates to using
auth
tenant (which is what the error is indicating)
so something, is adding the
/auth
path to the connection url
since it's self hosted by you, it's on you to figure out the issue 🙂
e
Ok got it thanks
n
@rp_st Now, we receive successful response but Supertokens session still does not exist in react native
r
can i see the response headers of the sign in API?
n
r
ok so this seems fine
what are the request headers?
n
@rp_st Do you mean this?
r
no, i mean i need to see all the request headers
to know if our network the interceptors are working as expected
also, are you using axios or fetch?
n
@rp_st Looks like that's all headers before sending the request: **{"Accept": "application/json, text/plain, */*", "rid": "thirdpartyemailpassword"}** Here is full response object - https://gist.github.com/olehferentswork/8515dbe88d8f0cb5b9bdf60564e71627 We are using axios, with SuperTokens.addAxiosInterceptors(axios);
r
What’s the request URL, And what’s the configured apDomain value?
n
Double-checked apiDomain, fixed it, now session exists in react native, thanks!
e
@rp_st Facing one more issue with this, I've specified backend for our setup like this and for ios works just fine, but in case with web i get Error: please provide exactly one client config or pass clientType or tenantId But i have specified clientType in the init function
r
@porcellus can help here
p
hi. what versions of the SDK are you using? Also, could you show what a
signinup
request looks like? Esp. the payload.
e
@porcellus Hello, we use latest one, updated just this weekend and this is the payload
p
this seems like an issue on our side, but I'm investigating a bit more.
e
@porcellus btw, I get this on the frontend, maybe it could help somehow
p
I think I've found the issue. Hopefully we can have a fix on a branch you can try in 1hrs.
There is a solution that seems to work for me. If you'd like to check it out, you can by running:
npm i supertokens-web-js@supertokens/supertokens-web-js#fix/clientType_in_combo_recipes
e
@porcellus Yes, it has resolved the issue, thanks! Should we proceed with this branch or there will be update related to this issue?
p
we will release this fairly soon I think.
You can use this until that happens, but I don't recommend it long-term since the branch will disappear when it gets merged
r
Hey @error404404404 we will release the fix today. You can create a GitHub issue about it to more easily track the release.
Hey @error404404404 we have released the fix. Please use the latest superrtokens-web-js version
0.7.2
e
@rp_st Thank you for the update
s
@porcellus could it be possible that this problem still exists in
supertokens-auth-react
? If I don't pass any clientType I get this error
Copy code
Error: please provide exactly one client config or pass clientType or tenantId
If I pass it it says that the clientType config is missing. It should be possible to not use clientType at all right?
r
@simon7000 could you please ask this as a new question?
3 Views