B2B Saas Authentication

/

Frontend SDKs

/

Headless

/

Members

/

Delete Self MFA TOTP

Delete Self MFA TOTP

The Delete Self MFA totp method wraps the Delete Member MFA TOTP 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 MFA totp.

To change a Member's totp, you must first call this endpoint to delete the existing totp.

Existing Member Sessions that include a TOTP authentication factor will not be revoked if the TOTP is deleted, and MFA will not be enforced until the Member logs in again. If you wish to enforce MFA immediately after a TOTP is deleted, you can do so by prompting the Member to create a new TOTP and calling the TOTP create endpoint, then calling the TOTP Authenticate endpoint.

You can listen for successful Member updates anywhere in the codebase with the stytch.organization.onMemberChange() method or useStytchMember hook if you are using React.

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

export const DeleteMFATOTP = () => {
  const stytch = useStytchB2BClient();

  const deleteMFATOTP = () => {
    stytch.self.deleteMFATOTP();
  };

  return <button onClick={deleteMFATOTP}>Delete TOTP</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
}