about summary refs log tree commit diff
path: root/src/login.rs
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2024-08-26 15:22:29 +0300
committerVika <vika@fireburn.ru>2024-08-26 15:23:22 +0300
commit31a0bdad439a4575c1686f690e9e72bd44dde472 (patch)
tree6b8c9132c19445d997bd75964604b069ffbd573f /src/login.rs
parentc79e950ca22c7a957c11e510700664327b042115 (diff)
Add HTTP fetcher cache
It just does its thing in the background, potentially speeding up
things. Maybe I could also use the underlying in-memory cache
implementation (Moka) to speed up my database. I heard crates.io got
some good results from that.
Diffstat (limited to 'src/login.rs')
-rw-r--r--src/login.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/login.rs b/src/login.rs
index bfa84b3..e105bcc 100644
--- a/src/login.rs
+++ b/src/login.rs
@@ -48,7 +48,7 @@ struct LoginForm {
 async fn post(
     Host(host): Host,
     mut cookies: SignedCookieJar,
-    State(http): State<reqwest::Client>,
+    State(http): State<reqwest_middleware::ClientWithMiddleware>,
     Form(form): Form<LoginForm>,
 ) -> axum::response::Response {
     let code_verifier = kittybox_indieauth::PKCEVerifier::new();
@@ -204,7 +204,7 @@ async fn callback(
     Host(host): Host,
     Query(result): Query<AuthorizationResponse>,
     cookie_jar: SignedCookieJar,
-    State(http): State<reqwest::Client>,
+    State(http): State<reqwest_middleware::ClientWithMiddleware>,
     State(session_store): State<crate::SessionStore>,
 ) -> axum::response::Response {
     let client_id: url::Url = format!("https://{}/.kittybox/login/client_metadata", host).parse().unwrap();
@@ -355,7 +355,7 @@ pub fn router<St, S>() -> axum::routing::Router<St>
 where
     St: Clone + Send + Sync + 'static,
     cookie::Key: FromRef<St>,
-    reqwest::Client: FromRef<St>,
+    reqwest_middleware::ClientWithMiddleware: FromRef<St>,
     crate::SessionStore: FromRef<St>,
     S: Storage + FromRef<St> + Send + Sync + 'static,
 {