File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ mod tests {
20
20
. into_token ( & algorithm)
21
21
. unwrap ( ) ;
22
22
23
- let jwt = Jwt :: < String > :: verify ( & token, & algorithm)
23
+ let jwt = Jwt :: < String > :: check ( & token, & algorithm)
24
24
. unwrap ( ) ;
25
25
}
26
26
@@ -36,7 +36,7 @@ mod tests {
36
36
let algorithm_2 = HS256Algorithm :: new ( "else" . as_bytes ( ) )
37
37
. unwrap ( ) ;
38
38
39
- let jwt = Jwt :: < String > :: verify ( & token, & algorithm_2) ;
39
+ let jwt = Jwt :: < String > :: check ( & token, & algorithm_2) ;
40
40
41
41
assert ! ( jwt. is_err( ) ) ;
42
42
}
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ where T : Serialize + for<'a> Deserialize<'a>,
63
63
/// instance with the expected payload. Note that this does not check any claims. To verify
64
64
/// basic expiry claims you can use [Jwt::verify_now] or you can further verify the token using
65
65
/// [Jwt::against] or [Jwt::guard].
66
- pub fn verify < A : JwAlg > ( token : & str , algorithm : & A ) -> Result < Jwt < T > , JwtError >
66
+ pub fn check < A : JwAlg > ( token : & str , algorithm : & A ) -> Result < Jwt < T > , JwtError >
67
67
where <A as JwAlg >:: Error : ' static
68
68
{
69
69
let mut parts = token. split ( '.' ) ;
@@ -101,12 +101,12 @@ where T : Serialize + for<'a> Deserialize<'a>,
101
101
} )
102
102
}
103
103
104
- /// Largely the same as [Jwt::verify ], but also verifies basic expiry claims. You can further
104
+ /// Largely the same as [Jwt::check ], but also verifies basic expiry claims. You can further
105
105
/// verify the token using [Jwt::against] or [Jwt::guard].
106
106
pub fn verify_now < A : JwAlg > ( token : & str , algorithm : & A ) -> Result < Jwt < T > , JwtError >
107
107
where <A as JwAlg >:: Error : ' static
108
108
{
109
- let jwt = Jwt :: < T > :: verify ( token, algorithm) ?
109
+ let jwt = Jwt :: < T > :: check ( token, algorithm) ?
110
110
. against ( & JwtClaims :: now ( ) ) ?;
111
111
112
112
Ok ( jwt)
You can’t perform that action at this time.
0 commit comments