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

@@ -180,10 +180,7 @@ pub fn session_login(
}
}
pub fn session_send2fa(
session_id: SessionID,
code: String,
) {
pub fn session_send2fa(session_id: SessionID, code: String) {
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
session.send2fa(code);
}
@@ -2026,20 +2023,15 @@ pub fn main_supported_input_source() -> SyncReturn<String> {
}
pub fn main_generate2fa() -> String {
crate::auth_2fa::generate2fa()
generate2fa()
}
pub fn main_verify2fa(code: String) -> bool {
let res = crate::auth_2fa::verify2fa(code);
if res {
refresh_options();
}
res
verify2fa(code)
}
pub fn main_has_valid_2fa_sync() -> SyncReturn<bool> {
let raw = get_option("2fa");
SyncReturn(crate::auth_2fa::get_2fa(Some(raw)).is_some())
SyncReturn(has_valid_2fa())
}
#[cfg(target_os = "android")]