-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App crash on jwt encode
command with @
in secret
#335
Comments
Thanks for writing in, and sorry for the delay @dhra. The use of Unfortunately I don't have a good suggestion for how to get around this issue. You could change your secret to be something like If you have suggestions for alternatives, please let me know |
This seems to affect also
@mike-engel isn't this more flexible with a new flag like |
In theory, yes. Using @t18n I'm unable to get
|
It will still return the token, but if I verify it with the secret used to generate the token, it will fail (testable with jwt.io). For example:
This will fail when verified with |
@t18n I believe this is a shell issue, and not an issue with I'm using zsh locally, and I've added a
As you can see, the shell is truncating the string after
|
@mike-engel thank you so much for the investigation and the solution. I use |
Summary
The
jwt encode
command crashes when using a secret containing special characters. The crash occurs due to the inability to read the file specified by the --secret parameter.Steps to reproduce
Run the following command
jwt encode --secret=@@@vovocha '{"hello":"world"}'
Actual result
Expected behavior
Users should be able to create a valid JWT with secrets that start with the '@' symbol.
More details:
OS: Ubuntu
The text was updated successfully, but these errors were encountered: