Hello. I am configuring a medusa instance with backend + back office together on production mode.
- I set the NODE_ENV to production.
- I have set the .env.production identical to the .env
- I build and start the medusa project
Until this, it is fine. But when the admin dashboard is ready. If I try to log in, it process then goes back to admin log-in page. The backend logs says 401 unauthorized, but the super user is properly set.
the url is http://localhost:9000/app/login so I believe there is not a problem CORS.
I tried to set the NODE_ENV=development and it works properly.
N.B :
- The database is properly configured
- the curl http://localhost:9000/health works on every case (development or production NODE_ENV)
- Medusa version : "@medusajs/medusa": "^1.20.6"
- Admin version : "@medusajs/admin": "^7.1.14"
Here is an example of the two commands I run :
NODE_ENV=production yarn run build
NODE_ENV=production npx medusa start&
Do you have an idea on what is going on ?