#Medusa on Localhost giving 401
54 messages · Page 1 of 1 (latest)
These creds should work?
https://docs.medusajs.com/admin/quickstart#demo-credentials
Backend is on http://localhost:9000/app/login by default
These credentials does not work. I can see these are indeed in the database
Did you possibly change the ADMIN_CORS variable?
Though you'd get a CORS error, not a 401 I think
I would try running medusa user -e [email protected] -p password with the CLI tools and see if you can manually add a new user
It's indeed 401, unathorized error. I used the cli to add new user, new user is added.
One more thing i want to know here. Is it normal behaviour of medusa admin ui, that it shows these error but after login it does not show this on AWS
Where does AWS come into the picture?
It was showing these error 401 unauthorized, then i thought it's may be due to cookie , so i setup aws instance with nginx with ssl certs
on localhost, i am getting these errors , while on AWS i can see these errors as well on login page, but i can login, while on localhost it's not loging in
What are you using for postgres? Might be a pointing to the wrong DB somewhere?
locally?
docker or actual install
Database is on AWS indeed the database is connected and migrations are applied to correct database
It's standalone installtion, because i want to dockerize it but as it's not working as standalone
I've done some work getting it up and running with docker compose here:
https://github.com/irab/medusa-container-build
It's kinda working for me with a lot of fiddling
can you tell me what is the default behaviour on login page, does network tab shows these error without login?
Yes, default behaviour is regular 401 for those batch job requests
Auth 401s are only if you try and fail to login
I'll just double check
let me share more with you, thank for the input
looks like it
this is my instance running on aws with nginx, can you please check this
https://medusa.linuxhunter.com/app/login
getting an application error on that
can you share that error?
Here what i see
I think unfortunately your backend has died but you're just seeing the UI cached
https://medusa.linuxhunter.com/app/ gives me a 502
let me restart it
Which means the downstream service is unreachable
give me a moment,let me fix it
can you check it now
@cosmic ocean
email: [email protected]
password:supersecret
works for me, can login
I can also login but what about these errors in network tab?
Without login, i can see these
Are they old? Once I'm logged in they're all 200s. Clear the console log and then click around once logged in and you shouldn't see any 401s
Yes, i can see all are good, but my concern is without login , does these errors are default? is it good for production?
Ah yes, these are completely normal. You want unauthorised people to be denied access
Though the batch requests I think is a bug, as it probably shouldn't be making those if you're not logged in
Any suggestions and improvements on the production setup?
Thank you, you saved my day, It was not documented
I would edit the seed.json to remove the creation of the default user or just delete them from the DB
i will do that, anything else for production? i am using medusa start for production build
There's a big long list of what to do for productions and I still haven't got my project into production either. But here's some off the top of my head:
- Setup regular DB backups
- Understand how the migrations command works
- Give at least 4GB of RAM to the instance running Medusa
- Seperate out the Admin UI and don't server from the same server that's running Medusa (I've managed to get it running as a static deployment from a Google Storage Bucket with a bit of help from CloudFlare magic)
All of above are done, only left with medusa admin ui, i am also think to host them on s3 with cloudfront
But I am confused what is the default path for the static resource for admin ui
as medusa develop generate them
errgh yeah took me a far too long to figure out
Can you share that, I am also looking for this
I sent the DM to you. If you are ok please share it