mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-10 12:27:44 +00:00
docs(admin): added missing updateUser api (#4846)
This commit is contained in:
@@ -259,6 +259,29 @@ type setUserPassword = {
|
||||
```
|
||||
</APIMethod>
|
||||
|
||||
### Update user
|
||||
|
||||
Update a user's details.
|
||||
|
||||
<APIMethod
|
||||
path="/admin/update-user"
|
||||
method="POST"
|
||||
requireSession
|
||||
>
|
||||
```ts
|
||||
type adminUpdateUser = {
|
||||
/**
|
||||
* The user id which you want to update.
|
||||
*/
|
||||
userId: string = "user-id"
|
||||
/**
|
||||
* The data to update.
|
||||
*/
|
||||
data: Record<string, any> = { name: "John Doe" }
|
||||
}
|
||||
```
|
||||
</APIMethod>
|
||||
|
||||
### Ban User
|
||||
|
||||
Bans a user, preventing them from signing in and revokes all of their existing sessions.
|
||||
|
||||
@@ -492,6 +492,21 @@ export const admin = <O extends AdminOptions>(options?: O) => {
|
||||
});
|
||||
},
|
||||
),
|
||||
/**
|
||||
* ### Endpoint
|
||||
*
|
||||
* POST `/admin/update-user`
|
||||
*
|
||||
* ### API Methods
|
||||
*
|
||||
* **server:**
|
||||
* `auth.api.adminUpdateUser`
|
||||
*
|
||||
* **client:**
|
||||
* `authClient.admin.updateUser`
|
||||
*
|
||||
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-update-user)
|
||||
*/
|
||||
adminUpdateUser: createAuthEndpoint(
|
||||
"/admin/update-user",
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user