Hey, <@498057949541826571> I have integrated supertokens passwordless receipe in backend python(fas...
m
Hey, @rp_st I have integrated supertokens passwordless receipe in backend python(fastAPI) where I used 2 endpoints /signinup/code and /signinup/code/consume It's working fine and override these both endpoints and added some logic, so our frontend react-native have to use backend API only but if we are using backend API we get session false when we are using supertokens endpoint for the same then everything is working good FE can get session True Thanks!!
r
hey @monster71554 could you please rephrase the question to make it more clear? Thanks
m
okay so I have integrated supertokens endpoint http://0.0.0.0:9090/auth/signinup/code and http://0.0.0.0:9090/auth/signinup/code/consume in my BE in an API called /send_otp and /verify_otp now when my FE is trying to call my APIs /send_otp and /verify_otp FE gets session false but when FE is directly called http://0.0.0.0:9090/auth/signinup/code and http://0.0.0.0:9090/auth/signinup/code/consume FE is able to get session True Can you suggest me how can I use my server as middleware because I have added some logic as per feature in both APIs of send_otp and verify_otp I hope now its understandable
r
i still don't understand. Is verifySession returning 401? Is that the issue?
n
I have integrated super-token with react-native using passwordless recipe. And after login every time doesSessionExist method returns false but the have checked cookies it shows sAccessToken and Refresh token stored on Front end side. [When using Backend api] - but i used superToken auth endpoints in place of backend endpoints then i got perfect response from doesSessionExist method.
m
Hey @rp_st yes, So Is there any method so that we are able to use backend APIs which is used supertokens auth endopints and we will get doesSessionExist in ReactNative side Bool(True) Is it okay or need to explain more about that?
r
@nkshah2 can help
n
Whats the config you use when initialising SuperTokens? (Both the frontend and backend)
n
At frontend side, I have used backend baseURL as apiDomain in configs
n
Can you post both the configs please
m
SupertokensConfig( connection_uri=conf.SUPER_TOKEN_CONNECTION_URL, api_key="rutu" ) config for BE
sharing same for FE
n
configs for Frontend SuperTokens.init({ apiDomain: APP_BASE_URL, });
n
Ill need the exact value for apiDomain being sent on both the backend and frontend
m
sorry, I Didn't get it
n
When initialising SuperTokens you pass
appInfo
on both the frontend and backend (similar to the frontend snippet you sent). I need the value of that
m
ahh wait
app_info=InputAppInfo( app_name="wahtsapp-feedback-app", api_domain="http://0.0.0.0:9090", website_domain="http://0.0.0.0:3000", api_base_path="/auth", website_base_path="/auth", )
our domain is something like https://whatsapp-feedback-app.abc.co.in
That's what you are asking for right?
n
Can you send me the response for when you call your consume API vs the supertokens exposed consume API from your FE?
(Please include the request and response headers)
m
yes sure, sharing
n
This is request and response while using superToken exposed consume API
this is the request and response while using BE consume api
n
Right so the default API is using headers (the react native sdk defaults to using headers instead of cookies) but in your version of the APIs you are using the set cookie header and returning the tokens as part of the response body and not headers. If you match the response format of the supertokens version of the APIs exactly (same body params and headers etc) it will all work
m
thanks!!