verifyPassword()
Check that the user's password matches the supplied input. Useful for custom auth flows and re-verification.
function verifyPassword: (params: VerifyPasswordParams) => Promise<{ verified: true }>;
VerifyPasswordParams
Name | Type | Description |
---|---|---|
userId | string | The ID of the user to verify the password for. |
password | string | The password to verify. |
verifyPassword()
example
const response = await clerkClient.users.verifyPassword({ userId: "user_123", password: "testpassword123" }) console.log(response); /* { verified: true } */
Backend API (BAPI) endpoint
This method in the SDK is a wrapper around the BAPI endpoint POST/users/{user_id}/verify_password
. See the BAPI reference(opens in a new tab) for more details.