Im trying to create a client portal and dont want the clients being able to login to the admin panel but cant find anything anywhere on how to do this?
You are a legend, thankyou!
In your Users collection (or the one you're using for auth, under
access
you can add additional property
admin
:
access: {
create: // ...,
read: // ... ,
update: // ...,
delete: // ...,
admin: ({ req: { user } }) => user?.role === 'admin',
},
This way, only users with the role
admin
will be able to access the admin panel.
Star
Discord
online
Get dedicated engineering support directly from the Payload team.