Skip to main content

removePassword()

Removes the password credential from the given user. This is a privileged operation and does not require the user's current password. Password removal is allowed even when the user has no other sign-in method configured.

By default, existing sessions remain active. Set signOutOfOtherSessions to true to revoke sessions active when the request is processed.

Returns the updated User.

function removePassword(userId: string, params: { signOutOfOtherSessions?: boolean }): Promise<User>
  • Name
    userId
    Type
    string
    Description

    The ID of the user whose password to remove.

  • Name
    params
    Type
    { signOutOfOtherSessions?: boolean; }
    Description

    Options for the request.

  • Name
    params.signOutOfOtherSessions?
    Type
    boolean
    Description

    When set to true, all of the user's active sessions are revoked after their password is removed. Defaults to false.

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.removePassword(userId)

Backend API (BAPI) endpoint

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

Feedback

What did you think of this content?

Last updated on