Documentation update

dequote and the count components are still missing
This commit is contained in:
2026-05-18 12:48:22 +02:00
parent 9757e7c279
commit 3cca849bd2
7 changed files with 46 additions and 54 deletions

View File

@@ -57,8 +57,8 @@ pub fn encode_token(header: &Header, id: String, key: &EncodingKey) -> String {
/// - `key`: The `DecodingKey` used to verify the JWT's signature.
///
/// # Returns
/// - `Ok(Claims)`: If the token is successfully decoded and verified, returns the extracted `Claims`.
/// - `Err((StatusCode, Json<Error>))`: If the token is invalid, expired, or cannot be decoded,
/// - `200 OK`: If the token is successfully decoded and verified, returns the extracted `Claims`.
/// - `401 UNAUTHORIZED`: If the token is invalid, expired, or cannot be decoded,
/// returns an `UNAUTHORIZED` status code along with a JSON error message.
pub fn decode_token(token: String, key: &DecodingKey) -> Result<Claims, (StatusCode, Json<Error>)> {
let mut validation = jsonwebtoken::Validation::new(jsonwebtoken::Algorithm::HS256);