diff --git a/gatherer/src/http_server/token_collect.rs b/gatherer/src/http_server/token_collect.rs index 98feaf5..7264322 100644 --- a/gatherer/src/http_server/token_collect.rs +++ b/gatherer/src/http_server/token_collect.rs @@ -48,16 +48,18 @@ pub struct OAuthCode { } pub async fn get_token_collect( - Extension(ServerState { db, http_client, .. }): Extension, + Extension(ServerState { db, http_client, mut store, .. }): Extension, extract::Path(host): extract::Path, extract::Query(OAuthCode { code }): extract::Query, ) -> impl IntoResponse { match collect_token(db, &http_client, &host, code.clone()).await { - Ok(()) => + Ok(()) => { + let _ = store.save_host(&host).await; ( StatusCode::SEE_OTHER, [("location", "/token/thanks")] - ).into_response(), + ).into_response() + } Err(e) => { tracing::error!("{}", e); return ( diff --git a/gatherer/src/http_server/token_donate.rs b/gatherer/src/http_server/token_donate.rs index a91ceba..deb87d4 100644 --- a/gatherer/src/http_server/token_donate.rs +++ b/gatherer/src/http_server/token_donate.rs @@ -14,7 +14,6 @@ pub async fn get_token_donate() -> impl IntoResponse { } #[derive(serde::Deserialize, Debug)] -//#[allow(dead_code)] pub struct TokenDonateForm { instance: String, }