Explicitly check for token expiration error (#4836)

This commit is contained in:
Gerard Guillemas Martos 2024-09-19 14:22:11 +01:00 committed by GitHub
parent 5e990d569b
commit 99db7f2a82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1539,7 +1539,11 @@ mod tests {
let mut sess = Session::default();
let res = token(&ds, &mut sess, &enc).await;
assert!(res.is_err(), "Unexpected success signing in with expired token: {:?}", res);
match res {
Err(Error::ExpiredToken) => {} // ok
Err(err) => panic!("Unexpected error signing in with expired token: {:?}", err),
res => panic!("Unexpected success signing in with expired token: {:?}", res),
}
}
#[tokio::test]