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
Trim potential whitespace around jwt before decoding (#120)
Given that JWTs are base64 encoded and can thus not have leading
or trailing whitespace, it is safe to trim the string before
decoding (e.g. the decoder on jwt.io appears to do the same). This
is mostly a convenience feature for people using jwt-cli like this:
# pbpaste prints the text from the clipboard on macOS
pbpaste | jwt decode -
When copying from UIs such the Fx developer tools it's not always
trivial to copy the value without any whitespace, and this change
avoids the extra step of having to remove that whitespace manually.
Of course e.g. piping through `xargs` would also be an option, but
is, in my opinion, very obscure especially when used in scripts.
0 commit comments