Record successful 2FA authentication in session cookie
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-03-25 18:04:54 +01:00
parent b704e9868b
commit 5644e40763
6 changed files with 51 additions and 13 deletions

View File

@ -13,12 +13,14 @@ use crate::data::current_user::CurrentUser;
use crate::data::totp_key::TotpKey;
use crate::data::user::User;
use crate::data::webauthn_manager::WebAuthManagerReq;
use crate::utils::time::fmt_time;
#[derive(Template)]
#[template(path = "settings/two_factors_page.html")]
struct TwoFactorsPage<'a> {
p: BaseSettingsPage<'a>,
user: &'a User,
last_2fa_auth: Option<String>,
}
#[derive(Template)]
@ -46,6 +48,7 @@ pub async fn two_factors_route(user: CurrentUser) -> impl Responder {
TwoFactorsPage {
p: BaseSettingsPage::get("Two factor auth", &user, None, None),
user: user.deref(),
last_2fa_auth: user.last_2fa_auth.map(fmt_time),
}
.render()
.unwrap(),