mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-13 11:35:56 +00:00
feat: numeric one-time password (#11846)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -56,6 +56,10 @@ class _DropDownAction extends StatelessWidget {
|
||||
final verificationMethod = gFFI.serverModel.verificationMethod;
|
||||
final showPasswordOption = approveMode != 'click';
|
||||
final isApproveModeFixed = isOptionFixed(kOptionApproveMode);
|
||||
final isNumericOneTimePasswordFixed =
|
||||
isOptionFixed(kOptionAllowNumericOneTimePassword);
|
||||
final isAllowNumericOneTimePassword =
|
||||
gFFI.serverModel.allowNumericOneTimePassword;
|
||||
return [
|
||||
PopupMenuItem(
|
||||
enabled: gFFI.serverModel.connectStatus > 0,
|
||||
@@ -94,6 +98,14 @@ class _DropDownAction extends StatelessWidget {
|
||||
value: "setTemporaryPasswordLength",
|
||||
child: Text(translate("One-time password length")),
|
||||
),
|
||||
if (showPasswordOption &&
|
||||
verificationMethod != kUsePermanentPassword)
|
||||
PopupMenuItem(
|
||||
value: "allowNumericOneTimePassword",
|
||||
child: listTile(translate("Numeric one-time password"),
|
||||
isAllowNumericOneTimePassword),
|
||||
enabled: !isNumericOneTimePasswordFixed,
|
||||
),
|
||||
if (showPasswordOption) const PopupMenuDivider(),
|
||||
if (showPasswordOption)
|
||||
PopupMenuItem(
|
||||
@@ -124,6 +136,9 @@ class _DropDownAction extends StatelessWidget {
|
||||
setPasswordDialog();
|
||||
} else if (value == "setTemporaryPasswordLength") {
|
||||
setTemporaryPasswordLengthDialog(gFFI.dialogManager);
|
||||
} else if (value == "allowNumericOneTimePassword") {
|
||||
gFFI.serverModel.switchAllowNumericOneTimePassword();
|
||||
gFFI.serverModel.updatePasswordModel();
|
||||
} else if (value == kUsePermanentPassword ||
|
||||
value == kUseTemporaryPassword ||
|
||||
value == kUseBothPasswords) {
|
||||
|
||||
Reference in New Issue
Block a user