Skip to content

Commit

Permalink
Tone down the colors
Browse files Browse the repository at this point in the history
  • Loading branch information
troyharvey committed Aug 2, 2018
1 parent 3b42eb0 commit dc852bb
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions bin/jwt.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ function niceDate(unixTimestamp) {
function processToken(token) {
if (token.string === undefined || token.string.split('.').length !== 3) {
console.log('jwt-cli - JSON Web Token parser [version 1.1.0]\n');
console.log(colors.yellow('Usage: jwt <encoded token>'));
console.info(colors.yellow('Usage: jwt <encoded token>\n'));
console.log('ℹ Documentation: https://www.npmjs.com/package/jwt-cli');
console.log('⚠ Issue tracker: https://github.com/troyharvey/jwt-cli/issues');
return;
}

Expand All @@ -26,14 +28,14 @@ function processToken(token) {

console.log(
'\n' +
colors.red('http://jwt.io/#id_token=') +
colors.green(token.parts[0]) + '.' +
colors.magenta('http://jwt.io/#id_token=') +
colors.cyan(token.parts[0]) + '.' +
colors.yellow(token.parts[1]) + '.' +
colors.red(token.parts[2])
colors.magenta(token.parts[2])
);

console.log(colors.green('\n✻ Header'));
console.log(colors.green(json.plain(token.decoded.header)));
console.log(colors.cyan('\n✻ Header'));
console.log(colors.cyan(json.plain(token.decoded.header)));

console.log(colors.yellow('\n✻ Payload'));
console.log(colors.yellow(json.plain(token.decoded.payload)));
Expand All @@ -42,7 +44,7 @@ function processToken(token) {
console.log(colors.yellow(' nbf: ') + niceDate(token.decoded.payload.nbf));
console.log(colors.yellow(' exp: ') + niceDate(token.decoded.payload.exp));

console.log(colors.red('\n✻ Signature ' + token.decoded.signature));
console.log(colors.magenta('\n✻ Signature ' + token.decoded.signature));
}

var token = {};
Expand Down

0 comments on commit dc852bb

Please sign in to comment.