https://supertokens.com/ logo
k

karanonymous

07/03/2022, 6:55 PM
It works great on my local, just cant get settings correct for ec2
r

rp

07/03/2022, 7:03 PM
Hey!
k

karanonymous

07/03/2022, 7:04 PM
Hi !
r

rp

07/03/2022, 7:04 PM
Can you show the CORS error? @karanonymous
k

karanonymous

07/03/2022, 7:05 PM
i tried with with
*
r

rp

07/03/2022, 7:05 PM
So you have set access control allow origin as *
k

karanonymous

07/03/2022, 7:05 PM
its set to
websiteDomain
but it doesnt work so I tried
*
r

rp

07/03/2022, 7:06 PM
Well, you should set it back to websiteDomain
k

karanonymous

07/03/2022, 7:06 PM
i thought so, and did
r

rp

07/03/2022, 7:06 PM
What’s the error that you get when you set it to websiteDomain?
k

karanonymous

07/03/2022, 7:07 PM
page loads but I cant create user or login
and I get these cors errors ofc
r

rp

07/03/2022, 7:08 PM
What’s the url of the page?
k

karanonymous

07/03/2022, 7:08 PM
I am hosting it on ec2
r

rp

07/03/2022, 7:09 PM
I mean what’s the url that’s typed on the browser?
r

rp

07/03/2022, 7:09 PM
Right. So that should be the value of websiteDomain on the backend and frontend
k

karanonymous

07/03/2022, 7:09 PM
yea but when I use that value in api-server.js
r

rp

07/03/2022, 7:11 PM
You need to use https not http
And then it should work
k

karanonymous

07/03/2022, 7:11 PM
oh lord, was it that silly
let me try
r

rp

07/03/2022, 7:11 PM
Cause this url redirects to https on load (as defined by Amazon)
k

karanonymous

07/03/2022, 7:12 PM
let me try real quick
change it both in api-server.js and /App.js right ?
r

rp

07/03/2022, 7:12 PM
Yes
k

karanonymous

07/03/2022, 7:16 PM
still getting this error
r

rp

07/03/2022, 7:17 PM
Hmmmm
k

karanonymous

07/03/2022, 7:18 PM
does that look correct to you.. I have hardcoded the values since its dev version
r

rp

07/03/2022, 7:19 PM
Yea. Seems fine. Are you sure that that’s getting loaded? Instead of the process env var
k

karanonymous

07/03/2022, 7:19 PM
i dont think I have process env var defined
r

rp

07/03/2022, 7:20 PM
Right
Can you open an issue about this on our GitHub? I’ll have a look tomorrow
k

karanonymous

07/03/2022, 7:21 PM
so when I go here now : http://ec2-54-88-43-105.compute-1.amazonaws.com:3000/ it tries to redirect me to https and breaks
r

rp

07/03/2022, 7:21 PM
Apparently the (very popular) lib we use to detect validity of domains thinks that the https version of the above link is not a valid domain
It breaks cause your server is not running?
k

karanonymous

07/03/2022, 7:22 PM
server running now, sorry, check
r

rp

07/03/2022, 7:22 PM
Still not loading anything
Maybe open an issue about this. And we will have a look
Will need to investigate why the lib thinks your domain is not w valid one
k

karanonymous

07/03/2022, 7:23 PM
sounds good. I might use my IP and try again coz it did send a refresh request right as we started chatting. If that doesnt work, ill open an issue
r

rp

07/03/2022, 7:29 PM
Cool.
k

karanonymous

07/03/2022, 7:31 PM
hey it worked when i use my public IP address
but I have to access it thought ip.. which is okay for me
r

rp

07/03/2022, 7:40 PM
Yeaaa. Ideally you should have some domain name and use that. The amazonaws.com domain name is a special domain name that is part of the Mozilla public suffix group. So something is wrong with the full URL that you are using. Will have to check