Enable MFA
The enableMFA
method is used to trigger MFA setup flow for users. The method takes W3ALoginParams
which will used during custom verifiers. If you are using default login providers, you don't need to pass W3ALoginParams
. If you are using custom jwt verifiers, you need to pass the valid JWT token in W3ALoginParams
as well.
Usage
- Default Verifier
- Custom JWT Verifier
do {
let isMFAEnabled = try await web3Auth.enableMFA()
} catch {
print(error.localizedDescription)
// Handle Error
}
do {
let loginParams = W3ALoginParams(
loginProvider: .JWT,
extraLoginOptions: .init(id_token: "your_jwt_token")
)
let isMFAEnabled = try await web3Auth.enableMFA(loginParams)
} catch {
print(error.localizedDescription)
// Handle Error
}