Skip to content

Commit

Permalink
Modify verification examples
Browse files Browse the repository at this point in the history
  • Loading branch information
suransea committed Dec 23, 2019
1 parent 07b44e9 commit 018a30f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ assert_eq!(token, "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzZWEifQ.L0DLt
use jwts::{Claims, ValidationConfig};
use jwts::jws::{Algorithm, Key, Token};

let token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzZWEiLCJleHAiOjE1NzcwODcxNjIsIm5iZiI6MTU3NzA4NzA2MiwiaWF0IjoxNTc3MDg3MDYyfQ.l87oZmjZzuiXQA2S_XIatbOA2l6Jnr4xXT5tyMLJyHM";
let token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzZWEiLCJleHAiOjEwNTc3MDkxMDU2LCJuYmYiOjE1NzcwOTEwNTYsImlhdCI6MTU3NzA5MTA1Nn0.4HwFlFB3LMhVc2xpsGBGSO3ut1KmnFdF8JrsL589ytw";

let key = Key::new(b"secret", Algorithm::HS256);
let verified: Token<Claims> = Token::verify_with_key(token, &key).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
//! use jwts::{Claims, ValidationConfig};
//! use jwts::jws::{Algorithm, Key, Token};
//!
//! let token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzZWEiLCJleHAiOjE1NzcwODcxNjIsIm5iZiI6MTU3NzA4NzA2MiwiaWF0IjoxNTc3MDg3MDYyfQ.l87oZmjZzuiXQA2S_XIatbOA2l6Jnr4xXT5tyMLJyHM";
//! let token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzZWEiLCJleHAiOjEwNTc3MDkxMDU2LCJuYmYiOjE1NzcwOTEwNTYsImlhdCI6MTU3NzA5MTA1Nn0.4HwFlFB3LMhVc2xpsGBGSO3ut1KmnFdF8JrsL589ytw";
//!
//! let key = Key::new(b"secret", Algorithm::HS256);
//! let verified: Token<Claims> = Token::verify_with_key(token, &key).unwrap();
Expand Down

0 comments on commit 018a30f

Please sign in to comment.