Skip to main content
Docs

lockUser()

Marks the given as locked, which means they are not allowed to sign in again until the lock expires.

By default, lockout duration is 1 hour, but it can be configured in the application's Attack protection settings. For more information, see the dedicated guide for customizing Attack protection settings.

function lockUser(userId: string): Promise<User>
  • Name
    userId
    Type
    string
    Description

    The ID of the user to lockout.

Note

Importing clerkClient varies based on your framework. Refer to the for usage details, including guidance on .

const userId = 'user_123'

const response = await clerkClient.users.lockUser(userId)

Backend API (BAPI) endpoint

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

Feedback

What did you think of this content?

Last updated on