Skip to main content
Docs

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 }>
  • Name
    userId
    Type
    string
    Description

    The ID of the user to verify the password for.

  • Name
    password
    Type
    string
    Description

    The password to verify.

Note

Importing clerkClient varies based on your framework. Refer to the Backend SDK overview for usage details, including guidance on how to access the userId and other properties.

const userId = 'user_123'

const password = 'testpassword123'

const response = await clerkClient.users.verifyPassword({
  userId,
  password,
})

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 for more information.

Feedback

What did you think of this content?

Last updated on