Skip to content

Commit

Permalink
Make non-recommended JWT claims optional (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
afroozeh authored Jun 28, 2024
1 parent 9bf06c7 commit b8ff4bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/validators/authorizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub struct ClerkJwt {
pub iat: i32,
pub iss: String,
pub nbf: i32,
pub sid: String,
pub sid: Option<String>,
pub sub: String,
}

Expand Down Expand Up @@ -111,7 +111,7 @@ pub fn validate_jwt(token: &str, jwks: JwksModel) -> Result<ClerkJwt, ClerkError

match decode::<ClerkJwt>(token, &decoding_key, &validation) {
Ok(token) => Ok(token.claims),
_ => Err(ClerkError::Unauthorized(String::from("Error: Invalid JWT!"))),
Err(err) => Err(ClerkError::Unauthorized(format!("Error: Invalid JWT! cause: {}", err))),
}
}
_ => Err(ClerkError::InternalServerError(String::from("Error: Unsupported key algorithm"))),
Expand Down

0 comments on commit b8ff4bb

Please sign in to comment.