Skip to content

Commit

Permalink
rename fn
Browse files Browse the repository at this point in the history
  • Loading branch information
aumetra committed Dec 17, 2024
1 parent dfe5d4d commit 6d0c865
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/komainu/src/code_grant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ where
}

#[instrument(skip_all)]
pub async fn extract<'a>(
pub async fn extract_raw<'a>(
&'a self,
req: &'a http::Request<()>,
) -> Result<Authorizer<'a, I>, GrantError> {
Expand All @@ -72,11 +72,6 @@ where

let client_id = query.get("client_id").or_invalid_request()?;
let response_type = query.get("response_type").or_invalid_request()?;
if *response_type != "code" {
debug!(?client_id, "response_type not set to \"code\"");
return Err(GrantError::AccessDenied);
}

let scope = query.get("scope").map(Deref::deref).unwrap_or("");
let state = query.get("state").map(|state| &**state);

Expand All @@ -88,6 +83,11 @@ where
}
}

if *response_type != "code" {
debug!(?client_id, "response_type not set to \"code\"");
return Err(GrantError::AccessDenied);
}

let request_scopes = scope.split_whitespace().collect::<HashSet<_>>();
let client_scopes = client
.scopes
Expand Down

0 comments on commit 6d0c865

Please sign in to comment.