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 isEnrolledInMfa(user: User, method?: MfaMethod): boolean;
Checks if the user is enrolled in MFA.
Parameters
| Parameter | Type | Description |
|---|
user | User | The user object. |
method? | MfaMethod | Optional specific method to check. If not provided, checks if user has any MFA method enrolled. |
Returns
boolean
True if the user is enrolled in the specified method (or any method if not specified), false otherwise.
Example
const user = await getCurrentUser();
// Check if user has any MFA enrolled
if (isEnrolledInMfa(user)) {
console.log("User has MFA enabled");
}
// Check if user has specific method enrolled
if (isEnrolledInMfa(user, "totp")) {
console.log("User has TOTP MFA enabled");
}
if (isEnrolledInMfa(user, "sms")) {
console.log("User has SMS MFA enabled");
}