You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Red.bold().paint("Something went awry creating the jwt\n")
540
-
);
534
+
bunt::eprintln!("{$red+bold}Something went awry creating the jwt{/$}\n");
541
535
eprintln!("{}", err);
542
536
exit(1);
543
537
}
@@ -552,54 +546,38 @@ fn print_decoded_token(
552
546
ifletErr(err) = &validated_token {
553
547
match err.kind(){
554
548
ErrorKind::InvalidToken => {
555
-
println!("{}",Red.bold().paint("The JWT provided is invalid"))
549
+
bunt::println!("{$red+bold}The JWT provided is invalid{/$}")
550
+
}
551
+
ErrorKind::InvalidSignature => {
552
+
bunt::eprintln!("{$red+bold}The JWT provided has an invalid signature{/$}")
553
+
}
554
+
ErrorKind::InvalidRsaKey => {
555
+
bunt::eprintln!("{$red+bold}The secret provided isn't a valid RSA key{/$}")
556
+
}
557
+
ErrorKind::InvalidEcdsaKey => {
558
+
bunt::eprintln!("{$red+bold}The secret provided isn't a valid ECDSA key{/$}")
556
559
}
557
-
ErrorKind::InvalidSignature => eprintln!(
558
-
"{}",
559
-
Red.bold()
560
-
.paint("The JWT provided has an invalid signature",)
561
-
),
562
-
ErrorKind::InvalidRsaKey => eprintln!(
563
-
"{}",
564
-
Red.bold()
565
-
.paint("The secret provided isn't a valid RSA key",)
566
-
),
567
-
ErrorKind::InvalidEcdsaKey => eprintln!(
568
-
"{}",
569
-
Red.bold()
570
-
.paint("The secret provided isn't a valid ECDSA key",)
571
-
),
572
560
ErrorKind::ExpiredSignature => {
573
-
eprintln!("{}",Red.bold().paint("The token has expired (or the `exp` claim is not set). This error can be ignored via the `--ignore-exp` parameter.",))
561
+
bunt::eprintln!("{$red+bold}The token has expired (or the `exp` claim is not set). This error can be ignored via the `--ignore-exp` parameter.{/$}")
574
562
}
575
563
ErrorKind::InvalidIssuer => {
576
-
println!("{}",Red.bold().paint("The token issuer is invalid"))
564
+
bunt::println!("{$red+bold}The token issuer is invalid{/$}")
577
565
}
578
-
ErrorKind::InvalidAudience => eprintln!(
579
-
"{}",
580
-
Red.bold()
581
-
.paint("The token audience doesn't match the subject",)
582
-
),
583
-
ErrorKind::InvalidSubject => eprintln!(
584
-
"{}",
585
-
Red.bold()
586
-
.paint("The token subject doesn't match the audience",)
587
-
),
588
-
ErrorKind::ImmatureSignature => eprintln!(
589
-
"{}",
590
-
Red.bold()
591
-
.paint("The `nbf` claim is in the future which isn't allowed",)
566
+
ErrorKind::InvalidAudience => {
567
+
bunt::eprintln!("{$red+bold}The token audience doesn't match the subject{/$}")
568
+
}
569
+
ErrorKind::InvalidSubject => {
570
+
bunt::eprintln!("{$red+bold}The token subject doesn't match the audience{/$}")
571
+
}
572
+
ErrorKind::ImmatureSignature => bunt::eprintln!(
573
+
"{$red+bold}The `nbf` claim is in the future which isn't allowed{/$}"
592
574
),
593
-
ErrorKind::InvalidAlgorithm => eprintln!(
594
-
"{}",
595
-
Red.bold().paint(
596
-
"The JWT provided has a different signing algorithm than the one you \
597
-
provided",
598
-
)
575
+
ErrorKind::InvalidAlgorithm => bunt::eprintln!(
576
+
"{$red+bold}The JWT provided has a different signing algorithm than the one you \
577
+
provided{/$}",
599
578
),
600
-
_ => eprintln!(
601
-
"{} {:?}",
602
-
Red.bold().paint("The JWT provided is invalid because"),
579
+
_ => bunt::eprintln!(
580
+
"{$red+bold}The JWT provided is invalid because{/$} {:?}",
0 commit comments