Fix readme
This commit is contained in:
parent
eae3743017
commit
7907b1cd79
|
@ -81,7 +81,7 @@ Last but not least, you will need to set the algorithm(s) allowed for this token
|
||||||
```rust
|
```rust
|
||||||
use jsonwebtoken::{Validation, Algorithm};
|
use jsonwebtoken::{Validation, Algorithm};
|
||||||
|
|
||||||
// Default valuation: the only algo allowed is HS256
|
// Default validation: the only algo allowed is HS256
|
||||||
let validation = Validation::default();
|
let validation = Validation::default();
|
||||||
// Quick way to setup a validation where only the algorithm changes
|
// Quick way to setup a validation where only the algorithm changes
|
||||||
let validation = Validation::new(Algorithm::HS512);
|
let validation = Validation::new(Algorithm::HS512);
|
||||||
|
|
|
@ -102,5 +102,4 @@ fn decode_header_only() {
|
||||||
let header = decode_header(token).unwrap();
|
let header = decode_header(token).unwrap();
|
||||||
assert_eq!(header.alg, Algorithm::HS256);
|
assert_eq!(header.alg, Algorithm::HS256);
|
||||||
assert_eq!(header.typ, Some("JWT".to_string()));
|
assert_eq!(header.typ, Some("JWT".to_string()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue