How to use the promptly.promptAsync function in promptly

To help you get started, we’ve selected a few promptly examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github auth0 / wt-cli / bin / profile.js View on Github external
.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');
                });
        });
}
github auth0 / wt-cli / bin / profile.js View on Github external
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);

promptly

Simple command line prompting utility

MIT
Latest version published 4 years ago

Package Health Score

74 / 100
Full package analysis