adminRoles Not Working

I am using the admin plugin with better-auth@1.3.4. I have the following configuration: admin({ adminRoles: ['SUPER_ADMIN'] }). However, when peforming admin actions, e.g. auth.api.listUsers() a user who has an active session with role: 'SUPER_ADMIN' will get the error message [Error [APIError]: You are not allowed to list users]. However, if I change the users role to admin they can then call listUsers(). It seems like the adminRoles configuration is being ignored.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?