Manage MFA
The manageMFA method triggers the multi-factor authentication (MFA) management flow, allowing
users to update their MFA settings.
It accepts an optional LoginParams parameter.
- If you use a default sign-in provider, call
manageMFA()without arguments. - If you use a custom JWT auth connection, pass a
LoginParamsobject that includes the JWT token.
Usage
- Default Auth Connection
- Custom JWT Auth Connection
do {
let response = try await web3Auth.manageMFA()
if response {
// Handle success
} else {
// Something went wrong
}
} catch {
// Handle error
}
let loginParams = LoginParams(
authConnection: .CUSTOM,
authConnectionId: "<YOUR_AUTH_CONNECTION_ID>",
idToken: "<YOUR_JWT_TOKEN>"
)
do {
let response = try await web3Auth.manageMFA(loginParams)
if response {
// Handle success
} else {
// Something went wrong
}
} catch {
// Handle error
}