
elvisl.77141 (Customer) asked a question.
I have deployed my app using express.js on the backend and react.js on the front-end. After I ran 'npm run build' and reference the build directory from Express, I was able to get my app to render the react components through the server-side.
The issue here is when making calls to the '@okta/okta-react' package such as okta.signIn(), I first got a 401 api/ Authentication error thinking it was a CORs or related problem. After further debugging, starting up client-side (npm start (dev), NOT npx serve(prod)), the okta.signIn() works.
Does the '@okta/okta-react' package not work in Production? Is it because I'm serving this as a static file through express? What is the solution here? Do i have to implement the okta server side instead, if so, whats the purpose of the react package?
Reason for using express:
- True HTTPS server-side
- Mailer Integration
- Other Third-party integration

Hi Elvis,
This is Dragos from Okta Support, based on the description provided, it might need some more troubleshooting on this. For that please send an email at Okta Developer Support (developers@okta.com) and one of our engineers will assist you on this matter.
Thank you,
Dragos Paval
Technical Support Engineer