After attempting to change all variables to env co...
# support-questions
d
After attempting to change all variables to env counterparts and setting up the system for release, I have triggered something that I cannot figure out. I have allowed all the "necessary' headers according to the warnings at some point - then I am a loop. I feel that there is a session lingering on which I cannot kill?
n
After attempting to change all variables to env counterparts and setting up the system for release, I have triggered something that I cannot figure out. I have allowed all the "necessary' headers according to the warnings at some point - then I am a loop. I feel that there is a session lingering on which I cannot kill?
Hi, can you send the config you use when calling SuperTokens.init on the frontend and backend? (Stripping any API keys you may be using)
d
sure
backend
Frontend
n
What are the values set for
BACKEND_URL
,
FRONTEND_URL
,
REACT_APP_BACKEND_URL
and
REACT_APP_FRONTEND_URL
?
d
Frontend
Backend
n
And just to make sure, your react app does start on PORT 3000 correct?
d
I do have this on my root file on NodeJS
n
You dont need to add the CORS headers manually
Can you remove them and try?
d
Sure
n
Just to be clear, the part where you do
app.use(cors()
should stay
d
yes
Let me set all the variables hard coded, instead of env variables
No luck, I will flip on debug mode
n
What version of supertokens-node are you using?
d
^9.1.2
n
Could you follow this troubleshooting guide and let us know https://supertokens.com/docs/thirdpartyemailpassword/troubleshooting/how-to-troubleshoot
d
Nothing here
n
Oh give me a bit
d
Sure, I will be going in transit now. I will respond slower.
n
Can you post the code where you add the SuperTokens middleware?
And can you check if
cors
is being added before or after the middleware
Were you seeing the same error after switching to local variables or was the error different?
d
same errors
I will change browsers
n
Yep try it with Chrome, out of curiosity
d
Chrome
It almost seems that I need to set the header manually
n
The
cors
middleware should handle that for you. Do you see any errors in your API server on startup?
Can you also try moving your Swagger route after the supertokens middleware and seeing if the behaviour changes?
I mean this part
app.use('/', swaggerUI.serve...)
d
I will try in a moment
OK, that worked lol
Nice catch
Now I have another issue, never encountered before
n
In the backend SuperTokens.init, you have overridden
signInUpPOST
. In that snippet can you log something after calling
originalImplementation.signInUpPOST
and check if it gets to that point?
d
sure
Wait, I will flush the system
n
Also if you have a default error handler (after adding the SuperTokens error handler) you can print there and check if you are getting any specific errors
d
It seems to be working now
I will have to check it out some more
thanks for you help so far
n
Happy to help, this thread will be active for the next 24 hours so feel free to ask more questions here
2 Views