diff --git a/flutter/lib/common/hbbs/hbbs.dart b/flutter/lib/common/hbbs/hbbs.dart index 3e44c2e36..b798c8c9b 100644 --- a/flutter/lib/common/hbbs/hbbs.dart +++ b/flutter/lib/common/hbbs/hbbs.dart @@ -67,7 +67,7 @@ class LoginRequest { String? password; String? id; String? uuid; - bool? autoLogin; + bool? trustThisDevice; String? type; String? verificationCode; Map deviceInfo = DeviceInfo.toJson(); @@ -77,7 +77,7 @@ class LoginRequest { this.password, this.id, this.uuid, - this.autoLogin, + this.trustThisDevice, this.type, this.verificationCode}); @@ -87,7 +87,7 @@ class LoginRequest { data['password'] = password ?? ''; data['id'] = id ?? ''; data['uuid'] = uuid ?? ''; - data['autoLogin'] = autoLogin ?? ''; + data['trustThisDevice'] = trustThisDevice ?? ''; data['type'] = type ?? ''; data['verificationCode'] = verificationCode ?? ''; data['deviceInfo'] = deviceInfo; diff --git a/flutter/lib/common/widgets/login.dart b/flutter/lib/common/widgets/login.dart index 122e69328..c9ac48069 100644 --- a/flutter/lib/common/widgets/login.dart +++ b/flutter/lib/common/widgets/login.dart @@ -416,7 +416,7 @@ Future loginDialog() async { password: password.text, id: await bind.mainGetMyId(), uuid: await bind.mainGetUuid(), - autoLogin: true, + trustThisDevice: false, type: HttpType.kAuthReqTypeAccount)); switch (resp.type) { @@ -476,7 +476,9 @@ Future loginDialog() async { ConfigOP(op: 'GitHub', iconWidth: 20), ConfigOP(op: 'Google', iconWidth: 20), ConfigOP(op: 'Okta', iconWidth: 38), - ].where((op) => oidcOptions.contains(op.op.toLowerCase())).toList(), + ] + .where((op) => oidcOptions.contains(op.op.toLowerCase())) + .toList(), curOP: curOP, cbLogin: (String username) { gFFI.userModel.userName.value = username; @@ -524,7 +526,7 @@ Future loginDialog() async { } Future verificationCodeDialog(UserPayload? user) async { - var autoLogin = true; + var trustThisDevice = false; var isInProgress = false; String? errorText; @@ -557,7 +559,7 @@ Future verificationCodeDialog(UserPayload? user) async { username: user?.name, id: await bind.mainGetMyId(), uuid: await bind.mainGetUuid(), - autoLogin: autoLogin, + trustThisDevice: trustThisDevice, type: HttpType.kAuthReqTypeEmailCode)); switch (resp.type) { @@ -605,6 +607,7 @@ Future verificationCodeDialog(UserPayload? user) async { focusNode: focusNode, helperText: translate('verification_tip'), ), + /* CheckboxListTile( contentPadding: const EdgeInsets.all(0), dense: true, @@ -612,12 +615,13 @@ Future verificationCodeDialog(UserPayload? user) async { title: Row(children: [ Expanded(child: Text(translate("Trust this device"))) ]), - value: autoLogin, + value: trustThisDevice, onChanged: (v) { if (v == null) return; - setState(() => autoLogin = !autoLogin); + setState(() => trustThisDevice = !trustThisDevice); }, ), + */ Offstage( offstage: !isInProgress, child: const LinearProgressIndicator()), diff --git a/src/lang/cn.rs b/src/lang/cn.rs index 30d7fa7ed..257aa14c1 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -221,7 +221,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Remember me", "记住我"), ("Trust this device", "信任此设备"), ("Verification code", "验证码"), - ("verification_tip", "检测到新设备登录,已向注册邮箱发送了登录验证码,请输入验证码继续登录"), + ("verification_tip", "已向注册邮箱发送了登录验证码,请输入验证码继续登录"), ("Logout", "登出"), ("Tags", "标签"), ("Search ID", "查找 ID"), diff --git a/src/lang/en.rs b/src/lang/en.rs index 2894b8257..c8e4f3f9f 100644 --- a/src/lang/en.rs +++ b/src/lang/en.rs @@ -37,7 +37,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("hide_cm_tip", "Allow hiding only if accepting sessions via password and using permanent password"), ("wayland_experiment_tip", "Wayland support is in experimental stage, please use X11 if you require unattended access."), ("Slogan_tip", "Made with heart in this chaotic world!"), - ("verification_tip", "A new device has been detected, and a verification code has been sent to the registered email address, enter the verification code to continue logging in."), + ("verification_tip", "A verification code has been sent to the registered email address, enter the verification code to continue logging in."), ("software_render_tip", "If you're using Nvidia graphics card under Linux and the remote window closes immediately after connecting, switching to the open-source Nouveau driver and choosing to use software rendering may help. A software restart is required."), ("config_input", "In order to control remote desktop with keyboard, you need to grant RustDesk \"Input Monitoring\" permissions."), ("request_elevation_tip", "You can also request elevation if there is someone on the remote side."), diff --git a/src/lang/tw.rs b/src/lang/tw.rs index 4e6b300fd..123a259e7 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -221,7 +221,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Remember me", "記住我"), ("Trust this device", "信任此裝置"), ("Verification code", "驗證碼"), - ("verification_tip", "檢測到新裝置登入,已向註冊電子信箱發送了登入驗證碼,請輸入驗證碼以繼續登入"), + ("verification_tip", "已向註冊電子信箱發送了登入驗證碼,請輸入驗證碼以繼續登入"), ("Logout", "登出"), ("Tags", "標籤"), ("Search ID", "搜尋 ID"), diff --git a/src/ui/index.tis b/src/ui/index.tis index 9431d98f4..669cc1b29 100644 --- a/src/ui/index.tis +++ b/src/ui/index.tis @@ -1195,7 +1195,7 @@ function login() { } abLoading = true; var url = handler.get_api_server(); - httpRequest(url + "/api/login", #post, {username: name, password: pass, id: my_id, uuid: handler.get_uuid()}, function(data) { + httpRequest(url + "/api/login", #post, {username: name, password: pass, id: my_id, uuid: handler.get_uuid(), type: 'account'}, function(data) { if (data.error) { abLoading = false; var err = translate(data.error);