Skip to content

Commit

Permalink
response_type not grant_type
Browse files Browse the repository at this point in the history
  • Loading branch information
aumetra committed Dec 7, 2024
1 parent 4ba3f2f commit af4f6da
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/komainu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ where
// consent answer.

let client_id = query.get("client_id").or_missing_param()?;
let grant_type = query.get("grant_type").or_missing_param()?;
let response_type = query.get("response_type").or_missing_param()?;
if *response_type != "code" {
debug!(?client_id, "response_type not set to \"code\"");
return Err(Error::Unauthorized);
}

let scope = query.get("scope").or_missing_param()?;
let redirect_uri = query.get("redirect_uri").or_missing_param()?;
Expand All @@ -109,7 +113,6 @@ where

Ok(Authorizer {
client,
grant_type,
query,
state,
})
Expand All @@ -118,7 +121,6 @@ where

pub struct Authorizer<'a> {
client: Client<'a>,
grant_type: &'a str,
query: ParamStorage<&'a str, &'a str>,
state: Option<&'a str>,
}
Expand Down

0 comments on commit af4f6da

Please sign in to comment.