about summary refs log tree commit diff
path: root/src/bin/kittybox-indieauth-helper.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/kittybox-indieauth-helper.rs')
-rw-r--r--src/bin/kittybox-indieauth-helper.rs28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/bin/kittybox-indieauth-helper.rs b/src/bin/kittybox-indieauth-helper.rs
index e7004c0..f4ad679 100644
--- a/src/bin/kittybox-indieauth-helper.rs
+++ b/src/bin/kittybox-indieauth-helper.rs
@@ -125,23 +125,19 @@ async fn main() -> Result<(), Error> {
 
         let router = axum::Router::new()
             .route("/callback", axum::routing::get(
-                move |query: Option<Query<AuthorizationResponse>>| async move {
-                    if let Some(Query(response)) = query {
-                        if let Some(tx) = tx.lock_owned().await.take() {
-                            tx.send(response).unwrap();
-
-                            (axum::http::StatusCode::OK,
-                             [("Content-Type", "text/plain")],
-                             "Thank you! This window can now be closed.")
-                                .into_response()
-                        } else {
-                            (axum::http::StatusCode::BAD_REQUEST,
-                             [("Content-Type", "text/plain")],
-                             "Oops. The callback was already received. Did you click twice?")
-                                .into_response()
-                        }
+                move |Query(response): Query<AuthorizationResponse>| async move {
+                    if let Some(tx) = tx.lock_owned().await.take() {
+                        tx.send(response).unwrap();
+
+                        (axum::http::StatusCode::OK,
+                         [("Content-Type", "text/plain")],
+                         "Thank you! This window can now be closed.")
+                            .into_response()
                     } else {
-                        axum::http::StatusCode::BAD_REQUEST.into_response()
+                        (axum::http::StatusCode::BAD_REQUEST,
+                         [("Content-Type", "text/plain")],
+                         "Oops. The callback was already received. Did you click twice?")
+                            .into_response()
                     }
                 }
             ));