Skip to Content
You are viewing a beta version of Clerk Docs
Visit the latest docs
Clerk logo

Clerk Docs

Ctrl + K
Go to clerk.com

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

NameTypeDescription
userIdstringThe ID of the user to verify the password for.
passwordstringThe 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.

What did you think of this content?

Clerk © 2024