Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async confirm(event) {
if (event) {
event.preventDefault();
}
const mfaType =
this.user['challengeName'] === ChallengeName.SoftwareTokenMFA ? ChallengeName.SoftwareTokenMFA : null;
if (!Auth || typeof Auth.confirmSignIn !== 'function') {
throw new Error('No Auth module found, please ensure @aws-amplify/auth is imported');
}
try {
await Auth.confirmSignIn(this.user, this.code, mfaType);
this.checkContact(this.user);
} catch (error) {
logger.error(error);
throw new Error(error);
}
}