import { getMfaMethods, isUserMissingMfaAuth } from '@dynamic-labs-sdk/client';
const onLogin = async () => {
const isMissingMfaAuth = isUserMissingMfaAuth();
if (!isMissingMfaAuth) {
// you don't need to do anything here
return;
}
// you should check if the has any registered MFA methods
const mfaMethods = await getMfaMethods();
const hasMfaMethods = mfaMethods.devices.length > 0 || mfaMethods.passkeys.length > 0;
if (!hasMfaMethods) {
// you should prompt the user to add a MFA method
} else {
// you should prompt the user to complete an MFA challenge
// you can check the different methods they have registered and display the appropriate UI
}
};