mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-10 04:19:32 +00:00
fix(admin): require adminRoles option for a role to be considered an admin role
This commit is contained in:
@@ -514,6 +514,20 @@ admin({
|
||||
defaultRole: "regular",
|
||||
});
|
||||
```
|
||||
### Admin Roles
|
||||
|
||||
The roles that are considered admin roles. Defaults to `["admin"]`.
|
||||
|
||||
```ts title="auth.ts"
|
||||
admin({
|
||||
adminRoles: ["admin", "superadmin"],
|
||||
});
|
||||
```
|
||||
|
||||
<Callout type="warning">
|
||||
Any role that isn't in the `adminRoles` list, even if they have the permission,
|
||||
will not be considered an admin.
|
||||
</Callout>
|
||||
|
||||
### Admin userIds
|
||||
|
||||
@@ -525,6 +539,8 @@ admin({
|
||||
})
|
||||
```
|
||||
|
||||
If a user is in the `adminUserIds` list, they will be able to perform any admin operation.
|
||||
|
||||
### impersonationSessionDuration
|
||||
|
||||
The duration of the impersonation session in seconds. Defaults to 1 hour.
|
||||
|
||||
Reference in New Issue
Block a user