MCPcopy Create free account
hub / github.com/Keats/jsonwebtoken / decode_token

Function decode_token

tests/hmac.rs:167–176  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

165#[test]
166#[wasm_bindgen_test]
167fn decode_token() {
168 let token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJiQGIuY29tIiwiY29tcGFueSI6IkFDTUUiLCJleHAiOjI1MzI1MjQ4OTF9.9r56oF7ZliOBlOAyiOFperTGxBtPykRQiWNFxhDCW98";
169 let claims = decode::<Claims>(
170 token,
171 &DecodingKey::from_secret(b"secret"),
172 &Validation::new(Algorithm::HS256),
173 );
174 println!("{:?}", claims);
175 claims.unwrap();
176}
177
178#[test]
179#[wasm_bindgen_test]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected