setPasswordCompromised() - Users | Clerk Docs

setPasswordCompromised()

Sets the given user's password as compromised. The user will be prompted to reset their password on their next sign-in. See the guide on password protection and rules for more information.

Returns the updated User.

function setPasswordCompromised(userId: string, params: { revokeAllSessions?: boolean }): Promise<User>

Parameters

Usage

Note

Using clerkClient varies based on the SDK you're using. Refer to the overview for usage details, including guidance on how to access the userId and other properties.

const userId = 'user_123'

const response = await clerkClient.users.setPasswordCompromised(userId, {
  revokeAllSessions: true,
})

Backend API (BAPI) endpoint

This method in the SDK is a wrapper around the BAPI endpoint POST/users/{user_id}/password/set_compromised. See the BAPI reference⁠ for more information.