feat: numeric one-time password

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2025-05-22 17:46:40 +08:00
parent 53709d8f8d
commit 89bb219376
2 changed files with 19 additions and 2 deletions

View File

@@ -22,7 +22,12 @@ pub enum ApproveMode {
// Should only be called in server
pub fn update_temporary_password() {
*TEMPORARY_PASSWORD.write().unwrap() = Config::get_auto_password(temporary_password_length());
*TEMPORARY_PASSWORD.write().unwrap() =
if Config::get_bool_option(crate::config::keys::OPTION_ALLOW_NUMERNIC_ONE_TIME_PASSWORD) {
Config::get_auto_numeric_password(temporary_password_length())
} else {
Config::get_auto_password(temporary_password_length())
};
}
// Should only be called in server