B2B Saas Authentication

/

Frontend SDKs

/

Headless

/

Members

/

Delete Self Password

Delete Self password

The Delete Self password method wraps the Delete Member password API endpoint. The organization_id and member_id will be automatically inferred from the logged-in Member's session. This method can only be used to delete the logged-in Member's password.

import { useStytchB2BClient, useStytchMember } from '@stytch/react/b2b';

export const DeletePassword = () => {
  const stytch = useStytchB2BClient();
  const { member } = useStytchMember();

  const deletePassword = () => {
    if (member?.member_password_id) {
      stytch.self.deletePassword(member.member_password_id);
    }
  };

  return <button onClick={deletePassword}>Delete Password</button>;
};

RESPONSE

200
{
    "member": {...},
    "member_id": "member-test-32fc5024-9c09-4da3-bd2e-c9ce4da9375f",
    "organization": {...}
    "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
    "status_code": 200
}