remove special treatment when only use permanent passwrod but no password set (#8566)

1. Remove special treatment when only use permanent passwrod  but no password set, it has  no need and `Connection not allowd` prompt make user confusing.
2. When only use permanent password is chosen and the permanent password
   is empty, pop up the set-password dialog, if still not set in the
   dialog, back to the old choice
3. Add cancel confirm for 2fa and telegram bot

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages 2024-07-02 14:32:22 +08:00 committed by GitHub
parent 51db8e706d
commit 8602b036bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
49 changed files with 170 additions and 18 deletions

View File

@ -2188,3 +2188,31 @@ void setSharedAbPasswordDialog(String abName, Peer peer) {
);
});
}
void CommonConfirmDialog(OverlayDialogManager dialogManager, String content,
VoidCallback onConfirm) {
dialogManager.show((setState, close, context) {
submit() {
close();
onConfirm.call();
}
return CustomAlertDialog(
content: Row(
children: [
Expanded(
child: Text(content,
style: const TextStyle(fontSize: 15),
textAlign: TextAlign.start),
),
],
).marginOnly(bottom: 12),
actions: [
dialogButton(translate("Cancel"), onPressed: close, isOutline: true),
dialogButton(translate("OK"), onPressed: submit),
],
onSubmit: submit,
onCancel: close,
);
});
}

View File

@ -838,7 +838,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
}
}
void setPasswordDialog() async {
void setPasswordDialog({VoidCallback? notEmptyCallback}) async {
final pw = await bind.mainGetPermanentPassword();
final p0 = TextEditingController(text: pw);
final p1 = TextEditingController(text: pw);
@ -878,6 +878,9 @@ void setPasswordDialog() async {
return;
}
bind.mainSetPermanentPassword(password: pass);
if (pass.isNotEmpty) {
notEmptyCallback?.call();
}
close();
}

View File

@ -684,10 +684,18 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
RxBool hasBot = bind.mainHasValidBotSync().obs;
update() async {
has2fa.value = bind.mainHasValid2FaSync();
setState(() {});
}
onChanged(bool? checked) async {
change2fa(callback: update);
if (checked == false) {
CommonConfirmDialog(
gFFI.dialogManager, translate('cancel-2fa-confirm-tip'), () {
change2fa(callback: update);
});
} else {
change2fa(callback: update);
}
}
final tfa = GestureDetector(
@ -716,10 +724,18 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
}
updateBot() async {
hasBot.value = bind.mainHasValidBotSync();
setState(() {});
}
onChangedBot(bool? checked) async {
changeBot(callback: updateBot);
if (checked == false) {
CommonConfirmDialog(
gFFI.dialogManager, translate('cancel-bot-confirm-tip'), () {
changeBot(callback: updateBot);
});
} else {
changeBot(callback: updateBot);
}
}
final bot = GestureDetector(
@ -873,12 +889,22 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
label: value,
onChanged: locked
? null
: ((value) {
() async {
: ((value) async {
callback() async {
await model.setVerificationMethod(
passwordKeys[passwordValues.indexOf(value)]);
await model.updatePasswordModel();
}();
}
if (value ==
passwordValues[passwordKeys
.indexOf(kUsePermanentPassword)] &&
(await bind.mainGetPermanentPassword())
.isEmpty) {
setPasswordDialog(notEmptyCallback: callback);
} else {
await callback();
}
}),
))
.toList();

View File

@ -2,6 +2,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hbb/desktop/pages/desktop_home_page.dart';
import 'package:flutter_hbb/mobile/widgets/dialog.dart';
import 'package:flutter_hbb/models/chat_model.dart';
import 'package:get/get.dart';
@ -101,18 +102,27 @@ class ServerPage extends StatefulWidget implements PageShape {
),
];
},
onSelected: (value) {
onSelected: (value) async {
if (value == "changeID") {
changeIdDialog();
} else if (value == "setPermanentPassword") {
setPermanentPasswordDialog(gFFI.dialogManager);
setPasswordDialog();
} else if (value == "setTemporaryPasswordLength") {
setTemporaryPasswordLengthDialog(gFFI.dialogManager);
} else if (value == kUsePermanentPassword ||
value == kUseTemporaryPassword ||
value == kUseBothPasswords) {
bind.mainSetOption(key: kOptionVerificationMethod, value: value);
gFFI.serverModel.updatePasswordModel();
callback() {
bind.mainSetOption(key: kOptionVerificationMethod, value: value);
gFFI.serverModel.updatePasswordModel();
}
if (value == kUsePermanentPassword &&
(await bind.mainGetPermanentPassword()).isEmpty) {
setPasswordDialog(notEmptyCallback: callback);
} else {
callback();
}
} else if (value.startsWith("AcceptSessionsVia")) {
value = value.substring("AcceptSessionsVia".length);
if (value == "Password") {

View File

@ -21,7 +21,7 @@ use crate::{
use hbb_common::{
anyhow::anyhow,
bail,
config::{keys::OPTION_ENABLE_HWCODEC, option2bool, Config, PeerConfig},
config::{option2bool, Config, PeerConfig},
lazy_static, log,
message_proto::{
supported_decoding::PreferCodec, video_frame, Chroma, CodecAbility, EncodedVideoFrames,
@ -836,6 +836,8 @@ impl Decoder {
#[cfg(any(feature = "hwcodec", feature = "mediacodec"))]
pub fn enable_hwcodec_option() -> bool {
use hbb_common::config::keys::OPTION_ENABLE_HWCODEC;
if cfg!(windows) || cfg!(target_os = "linux") || cfg!(target_os = "android") {
return option2bool(
OPTION_ENABLE_HWCODEC,
@ -846,6 +848,8 @@ pub fn enable_hwcodec_option() -> bool {
}
#[cfg(feature = "vram")]
pub fn enable_vram_option(encode: bool) -> bool {
use hbb_common::config::keys::OPTION_ENABLE_HWCODEC;
if cfg!(windows) {
let enable = option2bool(
OPTION_ENABLE_HWCODEC,

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", "确定要取消双重认证吗?"),
("cancel-bot-confirm-tip", "确定要取消 Telegram 机器人吗?"),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", "Telegram bot"),
("enable-bot-tip", "Pokud tuto funkci povolíte, můžete od svého bota obdržet kód 2FA. Může také fungovat jako oznámení o připojení."),
("enable-bot-desc", "1, Otevřete chat s @BotFather.\n2, Pošlete příkaz \"/newbot\". Po dokončení tohoto kroku obdržíte token.\n3, Spusťte chat s nově vytvořeným botem. Pro jeho aktivaci odešlete zprávu začínající lomítkem vpřed (\"/\"), například \"/hello\".\n"),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", "Telegram-Bot"),
("enable-bot-tip", "Wenn Sie diese Funktion aktivieren, können Sie den 2FA-Code von Ihrem Bot erhalten. Er kann auch als Verbindungsbenachrichtigung dienen."),
("enable-bot-desc", "1. Öffnen Sie einen Chat mit @BotFather.\n2. Senden Sie den Befehl \"/newbot\". Sie erhalten ein Token, nachdem Sie diesen Schritt abgeschlossen haben.\n3. Starten Sie einen Chat mit Ihrem neu erstellten Bot. Senden Sie eine Nachricht, die mit einem Schrägstrich (\"/\") beginnt, z. B. \"/hello\", um ihn zu aktivieren.\n"),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -229,5 +229,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("floating_window_tip", "It helps to keep RustDesk background service"),
("enable-bot-tip", "If you enable this feature, you can receive the 2FA code from your bot. It can also function as a connection notification."),
("enable-bot-desc", "1, Open a chat with @BotFather.\n2, Send the command \"/newbot\". You will receive a token after completing this step.\n3, Start a chat with your newly created bot. Send a message beginning with a forward slash (\"/\") like \"/hello\" to activate it.\n"),
("cancel-2fa-confirm-tip", "Are you sure you want to cancel 2FA?"),
("cancel-bot-confirm-tip", "Are you sure you want to cancel Telegram bot?"),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", "Bot Telgram"),
("enable-bot-tip", "If you enable this feature, you can receive the 2FA code from your bot. It can also function as a connection notification."),
("enable-bot-desc", "1, apri una chat con @BotFather.\n2, Invia il comando \"/newbot\", dopo aver completato questo passaggio riceverai un token.\n3, Avvia una chat con il tuo bot appena creato. Per attivarlo Invia un messaggio che inizia con una barra (\"/\") tipo \"/hello\".\n"),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", "Telegram bot"),
("enable-bot-tip", "Als u deze functie inschakelt, kunt u een 2FA-code ontvangen van uw bot. Het kan ook fungeren als een verbindingsmelding."),
("enable-bot-desc", "1, Open een chat met @BotFather.\n2, Verzend het commando \"/newbot\". Als deze stap voltooid is, ontvang je een token.\n3, Start een chat met de nieuw aangemaakte bot. Om hem te activeren stuurt u een bericht dat begint met een schuine streep (\"/\"), bijvoorbeeld \"/hello\".\n"),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", "Telegram-бот"),
("enable-bot-tip", "Если включено, можно получать код двухфакторной аутентификации от бота. Он также может выполнять функцию уведомления о подключении."),
("enable-bot-desc", "1) Откройте чат с @BotFather.\n2) Отправьте команду \"/newbot\". После выполнения этого шага вы получите токен.\n3) Начните чат с вашим только что созданным ботом. Отправьте сообщение, начинающееся с прямой косой черты (\"/\"), например, \"/hello\", чтобы его активировать.\n"),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", "Telegram bot"),
("enable-bot-tip", "Ak túto funkciu povolíte, kód 2FA môžete dostať od svojho bota. Môže fungovať aj ako upozornenie na pripojenie."),
("enable-bot-desc", "1, Otvorte chat s @BotFather.\n2, Odošlite príkaz \"/newbot\". Po dokončení tohto kroku dostanete token.\n3, Spustite chat s novo vytvoreným botom. Odošlite správu začínajúcu lomítkom vpred (\"/\"), napríklad \"/hello\", aby ste ho aktivovali.\n"),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -627,5 +627,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Telegram bot", ""),
("enable-bot-tip", ""),
("enable-bot-desc", ""),
("cancel-2fa-confirm-tip", ""),
("cancel-bot-confirm-tip", ""),
].iter().cloned().collect();
}

View File

@ -1,8 +1,8 @@
use super::{input_service::*, *};
#[cfg(any(target_os = "windows", target_os = "linux", target_os = "macos"))]
use crate::clipboard_file::*;
#[cfg(not(any(target_os = "android", target_os = "ios")))]
use crate::clipboard::update_clipboard;
#[cfg(any(target_os = "windows", target_os = "linux", target_os = "macos"))]
use crate::clipboard_file::*;
#[cfg(target_os = "android")]
use crate::keyboard::client::map_key_to_control_key;
#[cfg(target_os = "linux")]
@ -1745,11 +1745,6 @@ impl Connection {
.await;
}
return true;
} else if password::approve_mode() == ApproveMode::Password
&& !password::has_valid_password()
{
self.send_login_error("Connection not allowed").await;
return false;
} else if self.is_recent_session(false) {
if err_msg.is_empty() {
#[cfg(target_os = "linux")]