Browse Source

improved login output

master
Guillermo Rauch 9 years ago
parent
commit
f8040d6546
  1. 10
      lib/login.js

10
lib/login.js

@ -3,6 +3,7 @@ import { join as pathJoin } from 'path';
import fs from 'fs-promise'; import fs from 'fs-promise';
import fetch from 'node-fetch'; import fetch from 'node-fetch';
import { stringify as stringifyQuery } from 'querystring'; import { stringify as stringifyQuery } from 'querystring';
import chalk from 'chalk';
const stdin = process.openStdin(); const stdin = process.openStdin();
@ -58,17 +59,20 @@ async function register () {
const email = await readEmail(); const email = await readEmail();
const verificationToken = await getVerificationToken(email); const verificationToken = await getVerificationToken(email);
console.log('> Please follow the link in your email to log in.'); console.log(`> Please follow the link sent to ${chalk.bold(email)} to log in.`);
console.log('> Waiting for confirmation…'); process.stdout.write('> Waiting for confirmation..');
let final; let final;
do { do {
await sleep(5000); await sleep(2500);
try { try {
final = await verify(email, verificationToken); final = await verify(email, verificationToken);
} catch (e) {} } catch (e) {}
process.stdout.write('.');
} while (!final); } while (!final);
process.stdout.write('\n');
return { email, token: final }; return { email, token: final };
} }

Loading…
Cancel
Save