Hi! we are using the emailpassword recipe and using the signIn function as seen below: import { s...
r
Hi! we are using the emailpassword recipe and using the signIn function as seen below: import { signIn } from 'supertokens-auth-react/recipe/emailpassword' const response = await signIn({ formFields: [ { id: 'email', value: email, }, { id: 'password', value: password, }, ], }) However, we are getting a TypeError: can’t fetch error It also says cannot get auth/signin Wondering if the signIn function from the library is using a get method instead of post
r
hey! This usually means that the backend is not running - do you get a status code from the API call? (see the network tab)
r
The backend is actually running. The network tab status is cancelled :/ Also, signing in using the supertokens UI works perfectly
r
are you redirecting before the signIn function returns?
also, please check that the apiDomain is correctly set
r
Nope, not redirecting before the signIn function returns API domain on both FE and BE is set to our local host port
r
When the sign In function is called, does the backend log that the API is called?
r
Yup, the backend does log that We can also see on the network tab that the call is made to the right API
But the error “Failed to fetch” will appear
r
hmm. so then the fact that it's cancelled means that you are navigating away before it finishes the API call
r
And our response is empty
r
Which frontend SDK are you using?
supertokens-web-js or supertokens-auth-react?
r
Supertokens-auth-react
Really appreciate the help btw 🙂
r
I see. Are you partly going to use the pre built UI and partly custom UI?
r
Nope mainly the custom UI actually We just left the pre built UI in for now
r
I see.
I would encourage you to use supertokens-web-js everywhere instead of supertokens-auth-react
the auth-react SDK is specifically meant for pre built UI and it does navigation internally - which may cause issues with your custom UI
If you see the code snippets for custom UI in the docs, you will see that it uses the web-js SDK
r
Ah I see
Okay sure will try that out! Thanks so much 🙂
r
happy to help
r
Hey @rp_st, Tried changing to the web-JS sdk but still getting the same error :/
r
huh
can we get on a call for debugging?
r
Sure!