Log all user actions on stdout
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-11-19 13:38:24 +01:00
parent c242a492fc
commit d06c0352fc
14 changed files with 323 additions and 21 deletions

View File

@ -1,5 +1,6 @@
use std::ops::Deref;
use crate::constants::MAX_SECOND_FACTOR_NAME_LEN;
use actix_web::{HttpResponse, Responder};
use askama::Template;
use qrcode_generator::QrCodeEcc;
@ -25,6 +26,7 @@ struct AddTotpPage {
qr_code: String,
account_name: String,
secret_key: String,
max_name_len: usize,
}
#[derive(Template)]
@ -33,6 +35,7 @@ struct AddWebauhtnPage {
_p: BaseSettingsPage,
opaque_state: String,
challenge_json: String,
max_name_len: usize,
}
/// Manage two factors authentication methods route
@ -70,6 +73,7 @@ pub async fn add_totp_factor_route(user: CurrentUser) -> impl Responder {
qr_code: base64::encode(qr_code),
account_name: key.account_name(&user, AppConfig::get()),
secret_key: key.get_secret(),
max_name_len: MAX_SECOND_FACTOR_NAME_LEN,
}
.render()
.unwrap(),
@ -104,6 +108,7 @@ pub async fn add_webauthn_factor_route(
opaque_state: registration_request.opaque_state,
challenge_json: urlencoding::encode(&challenge_json).to_string(),
max_name_len: MAX_SECOND_FACTOR_NAME_LEN,
}
.render()
.unwrap(),