> For the complete documentation index, see [llms.txt](/llms.txt).

# Enable MFA for a user

The `enableMFA` method is used to trigger MFA setup flow for users. The method takes optional `LoginParams` for custom connections. If you are using default social login providers, you don't need to pass `LoginParams`. If you are using custom JWT connections, pass the JWT token in `loginParams` using `LoginParams.idToken`.

## Usage

**Default connection**

Usage

```dart
try {
  await Web3AuthFlutter.enableMFA();
} on UserCancelledException {
  log("User cancelled.");
} catch (e) {
  log("Unknown exception occurred");
}

```

**Custom JWT connection**

Usage

```dart
try {
  final loginParams = LoginParams(
    authConnection: AuthConnection.custom,
    authConnectionId: "YOUR_AUTH_CONNECTION_ID",
    idToken: "YOUR_JWT_TOKEN",
  );

  await Web3AuthFlutter.enableMFA(loginParams: loginParams);
} on UserCancelledException {
  log("User cancelled.");
} catch (e) {
  log("Unknown exception occurred");
}

```
