gatherer: add host to store when having token
This commit is contained in:
parent
cda567d0bc
commit
dd3dabf356
|
@ -48,16 +48,18 @@ pub struct OAuthCode {
|
|||
}
|
||||
|
||||
pub async fn get_token_collect(
|
||||
Extension(ServerState { db, http_client, .. }): Extension<ServerState>,
|
||||
Extension(ServerState { db, http_client, mut store, .. }): Extension<ServerState>,
|
||||
extract::Path(host): extract::Path<String>,
|
||||
extract::Query(OAuthCode { code }): extract::Query<OAuthCode>,
|
||||
) -> 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 (
|
||||
|
|
|
@ -14,7 +14,6 @@ pub async fn get_token_donate() -> impl IntoResponse {
|
|||
}
|
||||
|
||||
#[derive(serde::Deserialize, Debug)]
|
||||
//#[allow(dead_code)]
|
||||
pub struct TokenDonateForm {
|
||||
instance: String,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue