Skip to content

Accept different secret key types

I'd like to use this middleware, but my secret key is a base64 encoded string and not valid UTF-8. The underlying jsonwebtoken::{encode, decode} accepts a byte slice as a secret key, so this should be possible. Adding a method JWTMiddleware::from_slice(&[u8]) would allow for any binary secret key, and shouldn't be a breaking change.

I'm happy to submit a PR to implement this change.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information