()
| 222 | #[test] |
| 223 | #[wasm_bindgen_test] |
| 224 | fn decode_token_wrong_algorithm() { |
| 225 | let token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJiQGIuY29tIiwiY29tcGFueSI6IkFDTUUifQ.I1BvFoHe94AFf09O6tDbcSB8-jp8w6xZqmyHIwPeSdY"; |
| 226 | let claims = decode::<Claims>( |
| 227 | token, |
| 228 | &DecodingKey::from_secret(b"secret"), |
| 229 | &Validation::new(Algorithm::RS512), |
| 230 | ); |
| 231 | assert_eq!(claims.unwrap_err().into_kind(), ErrorKind::InvalidAlgorithm); |
| 232 | } |
| 233 | |
| 234 | #[test] |
| 235 | #[wasm_bindgen_test] |
nothing calls this directly
no outgoing calls
no test coverage detected