diff --git a/conduwuit-example.toml b/conduwuit-example.toml index 7a19b6b5..6ae6710c 100644 --- a/conduwuit-example.toml +++ b/conduwuit-example.toml @@ -23,7 +23,8 @@ # See the docs for reverse proxying and delegation: # https://continuwuity.org/deploying/generic.html#setting-up-the-reverse-proxy # -# Also see the `[global.auth]` and `[global.well_known]` config sections at the very bottom. +# Also see the `[global.auth]` and `[global.well_known]` config sections +# at the very bottom. # # Examples of delegation: # - https://puppygock.gay/.well-known/matrix/server @@ -1635,7 +1636,7 @@ # #enable_oidc_login = -# Whether this homeserver should provide users with an account management +# Whether this homeserver should provide users with an account management # interface. Only used if `enable_oidc_login` is set. Note that the # endpoint is unimplemented at the moment. # Unset by default. diff --git a/src/web/oidc/login.rs b/src/web/oidc/login.rs index f3d38493..40eeede5 100644 --- a/src/web/oidc/login.rs +++ b/src/web/oidc/login.rs @@ -2,10 +2,7 @@ use std::str::FromStr; use askama::Template; use axum::http::StatusCode; -use oxide_auth::{ - endpoint::QueryParameter, - frontends::simple::request::Body, -}; +use oxide_auth::{endpoint::QueryParameter, frontends::simple::request::Body}; use url::Url; use super::{AuthorizationQuery, LoginPageTemplate, OidcRequest, OidcResponse}; diff --git a/src/web/oidc/response.rs b/src/web/oidc/response.rs index 6d147095..aafaa788 100644 --- a/src/web/oidc/response.rs +++ b/src/web/oidc/response.rs @@ -25,8 +25,8 @@ pub struct OidcResponse { impl IntoResponse for OidcResponse { fn into_response(self) -> Response { let content_csp = match self.nonce { - | Some(nonce) => &format!("default-src 'nonce-{}'; form-action 'self';", nonce), - | None => "default-src 'none'; form-action 'self';" + | Some(nonce) => &format!("default-src 'nonce-{nonce}'; form-action 'self';"), + | None => "default-src 'none'; form-action 'self';", }; let content_type = match self.body { | Some(OAuthRequestBody::Json(_)) => "application/json", @@ -40,14 +40,9 @@ impl IntoResponse for OidcResponse { response = response.header(header::LOCATION, location.as_str()); } // Transform from OAuthRequestBody to String. - let body_content = self - .body - .map(|b| b.as_str().to_string()) - .unwrap_or_default(); + let body_content = self.body.map(|b| b.as_str().to_owned()).unwrap_or_default(); - response - .body(body_content.into()) - .unwrap() + response.body(body_content.into()).unwrap() } }