diff --git a/lib/komainu/src/authorize.rs b/lib/komainu/src/authorize.rs index f606acfc8..dd976a527 100644 --- a/lib/komainu/src/authorize.rs +++ b/lib/komainu/src/authorize.rs @@ -64,7 +64,7 @@ where let client_scopes = client .scopes .iter() - .map(|scope| scope.borrow()) + .map(Borrow::borrow) .collect::>(); if !request_scopes.is_subset(&client_scopes) { @@ -74,7 +74,7 @@ where let pkce_payload = if let Some(challenge) = query.get("code_challenge") { let method = if let Some(method) = query.get("challenge_code_method") { - PkceMethod::from_str(*method).map_err(Error::query)? + PkceMethod::from_str(method).map_err(Error::query)? } else { PkceMethod::default() }; diff --git a/lib/komainu/src/flow/mod.rs b/lib/komainu/src/flow/mod.rs index b1b24b202..512299e6d 100644 --- a/lib/komainu/src/flow/mod.rs +++ b/lib/komainu/src/flow/mod.rs @@ -42,7 +42,7 @@ impl PkcePayload<'_> { #[inline] fn verify_s256(&self, code_verifier: &str) -> Result<()> { let decoded = base64_simd::URL_SAFE - .decode_to_vec(code_verifier) + .decode_to_vec(self.challenge.as_bytes()) .inspect_err(|error| debug!(?error, "failed to decode pkce payload")) .map_err(Error::body)?; @@ -58,7 +58,6 @@ impl PkcePayload<'_> { #[inline] fn verify_none(&self, code_verifier: &str) -> Result<()> { let challenge_bytes = self.challenge.as_bytes(); - if challenge_bytes.ct_eq(code_verifier.as_bytes()).into() { Ok(()) } else {