Skip to content

Commit

Permalink
feat: improved auth error handle (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulobressan authored Dec 13, 2024
1 parent cbbdd59 commit 8f2aa62
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/driven/auth0/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ impl Auth0DrivenImpl {
#[async_trait::async_trait]
impl Auth0Driven for Auth0DrivenImpl {
fn verify(&self, token: &str) -> Result<String> {
let header = decode_header(token).map_err(|err| Error::Unexpected(err.to_string()))?;
let header = decode_header(token).map_err(|error| {
error!(?error);
Error::Unauthorized("invalid authorization token".into())
})?;

let Some(kid) = header.kid else {
return Err(Error::Unexpected(
Expand Down

0 comments on commit 8f2aa62

Please sign in to comment.