Documentation Index
Fetch the complete documentation index at: https://docs.cloud.coinbase.com/llms.txt
Use this file to discover all available pages before exploring further.
function getEnrolledMfaMethods(user: User): MfaMethod[];
Gets the list of MFA methods that the user has enrolled in.
Parameters
| Parameter | Type | Description |
|---|
user | User | The user object. |
Returns
MfaMethod[]
An array of enrolled MFA methods (‘totp’, ‘sms’, or both).
Example
const user = await getCurrentUser();
const methods = getEnrolledMfaMethods(user);
// methods = ['totp', 'sms']
if (methods.length > 1) {
// Prompt user to choose which method to use
const selectedMethod = await promptUser(methods);
await initiateMfaVerification({ mfaMethod: selectedMethod });
}