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.