sciter 2fa setting (#6951)

not add qr code text line as it's not selectable, and selectable input will steal the focus.

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2024-01-22 16:29:08 +08:00
committed by GitHub
parent b1a946ec20
commit 016f4abb32
6 changed files with 112 additions and 12 deletions

View File

@@ -1301,3 +1301,20 @@ pub fn support_remove_wallpaper() -> bool {
#[cfg(not(any(target_os = "windows", target_os = "linux")))]
return false;
}
pub fn has_valid_2fa() -> bool {
let raw = get_option("2fa");
crate::auth_2fa::get_2fa(Some(raw)).is_some()
}
pub fn generate2fa() -> String {
crate::auth_2fa::generate2fa()
}
pub fn verify2fa(code: String) -> bool {
let res = crate::auth_2fa::verify2fa(code);
if res {
refresh_options();
}
res
}