Update 2FA

This API will be used to update the user's 2FA enable / disable status. But each time user performs either of the actions, the user will be rquired to enter the current TOTP from the authenticator app.

Endpoint

PUT /2fa/update-user-2fa

Payload

This is a toggle API. Each time user enters a TOTP and trigger this API, the status of the 2FA will enabled if it was disabled and vise versa.

1 2 3 { "totp_code": "12345" }

Response

1 2 3 4 5 { success: true, msg: "Your 2FA has been disabled successfully.", user: {} // Updated user object }