Fix jwt::decode documentation in readme
Apparently jwt::decode expects the secret to be a slice. Thus blindly copying the example code from the readme gives a compilation error.
This commit is contained in:
parent
7e394c98e1
commit
8bfcebbd0e
|
@ -52,7 +52,7 @@ Look at `examples/custom_header.rs` for a full working example.
|
|||
|
||||
### Decoding
|
||||
```rust
|
||||
let token = decode::<Claims>(&token, "secret", &Validation::default())?;
|
||||
let token = decode::<Claims>(&token, "secret".as_ref(), &Validation::default())?;
|
||||
// token is a struct with 2 params: header and claims
|
||||
```
|
||||
`decode` can error for a variety of reasons:
|
||||
|
|
Loading…
Reference in New Issue