jwt-cli icon indicating copy to clipboard operation
jwt-cli copied to clipboard

App crash on `jwt encode` command with `@` in secret

Open dhra opened this issue 7 months ago • 1 comments

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

thread 'main' panicked at src/utils.rs:42:44:
Unable to read file @@vovocha
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Expected behavior

Users should be able to create a valid JWT with secrets that start with the '@' symbol.

More details:

jwt --version
jwt 6.1.0

OS: Ubuntu

dhra avatar Jun 30 '24 01:06 dhra