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:
Christoph Wurst 2017-11-25 10:38:43 +01:00 committed by GitHub
parent 7e394c98e1
commit 8bfcebbd0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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: