docs(admin): update usage instructions to include adminUserIds option

This commit is contained in:
Bereket Engida
2025-02-17 08:21:33 +03:00
parent 2020e1f24d
commit f737b3b02f

View File

@@ -67,7 +67,7 @@ The Admin plugin provides a set of administrative functions for user management
## Usage
Before performing any admin operations, the user must be authenticated with an admin account. An admin is any user assigned the `admin` role. For the first admin user, you'll need to manually assign the `admin` role to their account in your database.
Before performing any admin operations, the user must be authenticated with an admin account. An admin is any user assigned the `admin` role or any user whose ID is included in the `adminUserIds` option.
### Create User
@@ -332,6 +332,16 @@ admin({
})
```
### Admin userIds
You can pass an array of userIds that should be considered as admin. Default to `[]`
```ts title="auth.ts"
admin({
adminUserIds: ["user_id_1", "user_id_2"]
})
```
### impersonationSessionDuration
The duration of the impersonation session in seconds. Defaults to 1 hour.