Skip to content

Commit fbdfc04

Browse files
committed
🚚 Rename verify method to check
1 parent f681017 commit fbdfc04

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/modules/token/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ mod tests {
2020
.into_token(&algorithm)
2121
.unwrap();
2222

23-
let jwt = Jwt::<String>::verify(&token, &algorithm)
23+
let jwt = Jwt::<String>::check(&token, &algorithm)
2424
.unwrap();
2525
}
2626

@@ -36,7 +36,7 @@ mod tests {
3636
let algorithm_2 = HS256Algorithm::new("else".as_bytes())
3737
.unwrap();
3838

39-
let jwt = Jwt::<String>::verify(&token, &algorithm_2);
39+
let jwt = Jwt::<String>::check(&token, &algorithm_2);
4040

4141
assert!(jwt.is_err());
4242
}

src/modules/token/models/jwt.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ where T : Serialize + for<'a> Deserialize<'a>,
6363
/// instance with the expected payload. Note that this does not check any claims. To verify
6464
/// basic expiry claims you can use [Jwt::verify_now] or you can further verify the token using
6565
/// [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>
6767
where <A as JwAlg>::Error: 'static
6868
{
6969
let mut parts = token.split('.');
@@ -101,12 +101,12 @@ where T : Serialize + for<'a> Deserialize<'a>,
101101
})
102102
}
103103

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
105105
/// verify the token using [Jwt::against] or [Jwt::guard].
106106
pub fn verify_now<A: JwAlg>(token: &str, algorithm: &A) -> Result<Jwt<T>, JwtError>
107107
where <A as JwAlg>::Error: 'static
108108
{
109-
let jwt = Jwt::<T>::verify(token, algorithm)?
109+
let jwt = Jwt::<T>::check(token, algorithm)?
110110
.against(&JwtClaims::now())?;
111111

112112
Ok(jwt)

0 commit comments

Comments
 (0)