Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(function (verifyFunc) {
console.log('Please enter the verification code we sent to '
+ phoneOrEmail + ' below.');
return Promptly.promptAsync('Verification code:')
.then(verifyFunc)
.timeout(FIVE_MINUTES, 'Verification code expired.')
.catch(function (e) {
console.log('\n' + e.message.red + '\n');
});
});
}
function getVerifiedProfile (argv) {
var profile;
if (argv.params.email_or_phone) {
profile = sendVerificationCode(argv.params.email_or_phone);
} else {
console.log('Please enter your e-mail or phone number, we will send you a verification code.');
profile = Promptly.promptAsync('E-mail or phone number:')
.then(function (phoneOrEmail) {
return sendVerificationCode(phoneOrEmail);
});
}
return profile.then(function (data) {
return {
url: data.url,
container: data.tenant,
token: data.token,
};
})
.catch(function (err) {
console.log(('We were unable to verify your identity.').red);