Unable to login with accounts role=user at multi tenant example
Link to reproduction
No response
Describe the Bug
Logging as [email protected] at http://abc.localhost.com:3003/admin displays message:
Unauthorized, you must be logged in to make this request.
You are not allowed to access this page.
<Button>Log out</Button>
as [email protected] at http://abc.localhost.com:3000/admin/login seems to show dashboard correctly.
And thanks for all of your AMAZING work!
To Reproduce
- Setup mongo docker container
- cd to multi-tenant example code from
v2.11.2tag. - Run commands as instructed in README.md
- Setup /etc/hosts with abc.localhost.com pointing to 127.0.0.1
- Try to login with
[email protected]on localhost:3000 - all good. - Click Log out, Click log back in.
- Try to login with
[email protected]on abc.localhost.com:3000 - all good, access scoped well. - Click Log out, Click log back in.
- Try to login with
[email protected]on abc.localhost.com:3000 - shows "Unauthroized" message.
Payload Version
2.11.2
Adapters and Plugins
No response
This is expected behavior, though the error message is confusing. Non-admin users (like [email protected]) should not be able to access the admin UI which is why there is an error message. Logging-in with this account shows the message "Unauthorized, you must be logged in to make this request", however, this is misleading because the user is actually logged-in and calls to the API are successful (within the scope of their tenant permissions), it's just that they are not authorized to view the admin page.
Yeah the example does seem slightly confusing on what the use-case is for the ‘user’ role. As the demo is, its just for doing API calls pretty much. Not to access the GUI.