Record successful 2FA authentication in session cookie
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -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(),
|
||||
|
Reference in New Issue
Block a user