/v1/apps/{app_id}/end-users/{user_id}/mfa/require-reenrollmentAuthForce an end-user back through MFA enrolment
Disables every enabled factor on the account, destroys its recovery codes, and revokes every live session. The next sign-in on an app running `auth_config.mfa: "required"` returns `mfa_enrollment_required` and the user must enrol a new factor before a session is minted. On an app running `mfa: "optional"` the user simply ends up with no MFA, which is the pre-existing meaning of deleting their factors. All three steps matter: leaving the recovery codes alive would let whoever holds the old printout complete `/auth/mfa/recover` and skip enrolment entirely. Audited, and emits `user.mfa.factor_disabled` per factor plus one `user.mfa.reenrollment_required`. Idempotent.
Path parameters
app_id*stringId of the app.
user_id*stringId of the user.
Response · 200 Factors disabled, recovery codes destroyed, sessions revoked.
factors_disabled*numberHow many enabled factors were disabled. Zero when the account already held none — the call still destroys recovery codes and revokes sessions.
Example: 1
Example
Request
POST https://api.auth.productcraft.co/v1/apps/{app_id}/end-users/{user_id}/mfa/require-reenrollment
Authorization: Bearer YOUR_TOKENimport { Auth } from "@productcraft/auth";
// Admin routes read PRODUCTCRAFT_API_KEY; consumer routes need no key
const auth = new Auth();
const requireMfaReenrollment = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.mfa.requireReenrollment("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");auth.admin.app(…).endUsers.mfa.requireReenrollment(userId, options?): Auth.RequireMfaReenrollment
Response
{
"factors_disabled": 1
}