resetUserPassword()
resetUserPassword(
userId:string,newPassword:string):Promise<UserSimpleResponse>
Defined in: packages/core/src/index.ts:612
Reset a user's password (admin only)
Parameters
| Parameter | Type | Description |
|---|---|---|
userId | string | The unique identifier of the user |
newPassword | string | The new password to set |
Returns
Promise<UserSimpleResponse>
Confirmation of password reset
Throws
400 - Password does not meet requirements
Throws
401 - Not authenticated
Throws
403 - Admin privileges required
Throws
404 - User not found
Example
import { resetUserPassword } from "@cpod/sdk";
const result = await resetUserPassword("user-123", "newSecurePassword456");
console.log(result.message); // "Password reset successfully"