Documentation update
dequote and the count components are still missing
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user