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?
In your Users collection (or the one you're using for auth, under
accessyou can add additional property
admin:
access: {
create: // ...,
read: // ... ,
update: // ...,
delete: // ...,
admin: ({ req: { user } }) => user?.role === 'admin',
},This way, only users with the role
adminwill be able to access the admin panel.
You are a legend, thankyou!
Star
Discord
online
Get dedicated engineering support directly from the Payload team.