Frappe React SDK authentication error

I’ve been working on a project using frappe-react-sdk where my Frappe App is hosted in Frappe Cloud and React frontend is hosted in AWS. I was able to configure the connection to the Frappe App from the React frontend but while trying to make the authentication of user login in frappe through the React App, it is throwing an error.

Adding screenshot for reference.

Have you configured CORS on your Frappe Cloud site? (from site config)

(You are on localhost in screenshot btw.)

I did a allow_cors configuration to the localhost for now which is allowing me to access the frappe server. I checked it with the guest access and it is working.

If your React app is running on a different URL on production, then cookie based auth won’t work.

You’ll have to use OAuth to get a Bearer token, and then the bearer token can be used in Frappe React SDK to make API calls.
This is also applicable for mobile apps.