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

# enableMFA

Function to enable Multi-Factor Authentication (MFA) for users with Web3Auth.

info

Please note that this function doesn't work for external wallet logins. It only works for social login embedded wallets.

```
try {
  await web3auth.enableMFA()
  console.log('MFA setup process initiated')
} catch (error) {
  console.error('Error enabling MFA:', error)
}

```

### Interface[​](#interface "Direct link to Interface")

```
enableMFA<T>(loginParams?: T): Promise<void>;

```

#### `loginParams`[​](#loginparams "Direct link to loginparams")

Optional parameters for the login process when setting up MFA.

#### Return value[​](#return-value "Direct link to Return value")

`Promise<void>`

A promise that resolves when the MFA setup process has been initiated. This function will trigger a redirect to the MFA setup page, where the user will be asked to login again and set up the MFA methods according to the configuration set in the Web3Auth instance.
