Allow trusted devices for direct IP connections (#16778)

* Allow trusted devices for direct IP connections

Signed-off-by: fufesou <linlong1266@gmail.com>

* test: preserve existing V2 trusted-device credentials

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou authored and GitHub committed 2026-11-01 13:39:15 +08:00
1 parent 94c321d05c
commit c5201d600b
4 files changed
+47 -5

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@ use base::message_proto::LoginResponse;
impl Connection {
pub(super) async fn begin_trusted_device(&mut self) -> bool {
if self.conn_audit_primary_auth != ConnAuditPrimaryAuth::PermanentPassword
|| !self.stream.is_secured()
|| (!self.stream.is_secured() && !crate::common::is_direct_ip_access(&self.lr.username))
|| self.require_2fa.is_none()
|| self.from_switch
|| !hbb_common::config::Config::get_bool_option(