Update main
This commit is contained in:
1 file changed
+13
-5
+13
-5
@@ -2,10 +2,10 @@ mod db;
|
|||||||
|
|
||||||
use askama::Template;
|
use askama::Template;
|
||||||
use axum::{
|
use axum::{
|
||||||
|
Router,
|
||||||
extract::{Form, FromRef, State},
|
extract::{Form, FromRef, State},
|
||||||
response::{Html, Redirect},
|
response::{Html, Redirect},
|
||||||
routing::{get, post},
|
routing::{get, post},
|
||||||
Router,
|
|
||||||
};
|
};
|
||||||
use axum_extra::extract::cookie::{Cookie, Key, PrivateCookieJar};
|
use axum_extra::extract::cookie::{Cookie, Key, PrivateCookieJar};
|
||||||
use rusqlite::Connection;
|
use rusqlite::Connection;
|
||||||
@@ -103,7 +103,13 @@ async fn index(State(state): State<AppState>) -> Html<String> {
|
|||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
ExerciseStats { name, month, year, all_time, daily }
|
ExerciseStats {
|
||||||
|
name,
|
||||||
|
month,
|
||||||
|
year,
|
||||||
|
all_time,
|
||||||
|
daily,
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
@@ -129,9 +135,11 @@ async fn login_post(
|
|||||||
Ok((jar, Redirect::to("/manage")))
|
Ok((jar, Redirect::to("/manage")))
|
||||||
} else {
|
} else {
|
||||||
Err(Html(
|
Err(Html(
|
||||||
LoginTemplate { error: Some("Wrong password.".to_string()) }
|
LoginTemplate {
|
||||||
.render()
|
error: Some("Wrong password.".to_string()),
|
||||||
.unwrap(),
|
}
|
||||||
|
.render()
|
||||||
|
.unwrap(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user