From 99db7f2a82cb9b2841ad253dd8828ba42db5cf92 Mon Sep 17 00:00:00 2001 From: Gerard Guillemas Martos Date: Thu, 19 Sep 2024 14:22:11 +0100 Subject: [PATCH] Explicitly check for token expiration error (#4836) --- core/src/iam/verify.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/iam/verify.rs b/core/src/iam/verify.rs index da20f02d..18f27539 100644 --- a/core/src/iam/verify.rs +++ b/core/src/iam/verify.rs @@ -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]