Merge pull request #4699 from 21pages/trustThisDevice

rename autoLogin to trustThisDevice
This commit is contained in:
RustDesk 2023-06-20 10:33:01 +08:00 committed by GitHub
commit 2e5eb86c97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 13 deletions

View File

@ -67,7 +67,7 @@ class LoginRequest {
String? password; String? password;
String? id; String? id;
String? uuid; String? uuid;
bool? autoLogin; bool? trustThisDevice;
String? type; String? type;
String? verificationCode; String? verificationCode;
Map<String, dynamic> deviceInfo = DeviceInfo.toJson(); Map<String, dynamic> deviceInfo = DeviceInfo.toJson();
@ -77,7 +77,7 @@ class LoginRequest {
this.password, this.password,
this.id, this.id,
this.uuid, this.uuid,
this.autoLogin, this.trustThisDevice,
this.type, this.type,
this.verificationCode}); this.verificationCode});
@ -87,7 +87,7 @@ class LoginRequest {
data['password'] = password ?? ''; data['password'] = password ?? '';
data['id'] = id ?? ''; data['id'] = id ?? '';
data['uuid'] = uuid ?? ''; data['uuid'] = uuid ?? '';
data['autoLogin'] = autoLogin ?? ''; data['trustThisDevice'] = trustThisDevice ?? '';
data['type'] = type ?? ''; data['type'] = type ?? '';
data['verificationCode'] = verificationCode ?? ''; data['verificationCode'] = verificationCode ?? '';
data['deviceInfo'] = deviceInfo; data['deviceInfo'] = deviceInfo;

View File

@ -416,7 +416,7 @@ Future<bool?> loginDialog() async {
password: password.text, password: password.text,
id: await bind.mainGetMyId(), id: await bind.mainGetMyId(),
uuid: await bind.mainGetUuid(), uuid: await bind.mainGetUuid(),
autoLogin: true, trustThisDevice: false,
type: HttpType.kAuthReqTypeAccount)); type: HttpType.kAuthReqTypeAccount));
switch (resp.type) { switch (resp.type) {
@ -476,7 +476,9 @@ Future<bool?> loginDialog() async {
ConfigOP(op: 'GitHub', iconWidth: 20), ConfigOP(op: 'GitHub', iconWidth: 20),
ConfigOP(op: 'Google', iconWidth: 20), ConfigOP(op: 'Google', iconWidth: 20),
ConfigOP(op: 'Okta', iconWidth: 38), ConfigOP(op: 'Okta', iconWidth: 38),
].where((op) => oidcOptions.contains(op.op.toLowerCase())).toList(), ]
.where((op) => oidcOptions.contains(op.op.toLowerCase()))
.toList(),
curOP: curOP, curOP: curOP,
cbLogin: (String username) { cbLogin: (String username) {
gFFI.userModel.userName.value = username; gFFI.userModel.userName.value = username;
@ -524,7 +526,7 @@ Future<bool?> loginDialog() async {
} }
Future<bool?> verificationCodeDialog(UserPayload? user) async { Future<bool?> verificationCodeDialog(UserPayload? user) async {
var autoLogin = true; var trustThisDevice = false;
var isInProgress = false; var isInProgress = false;
String? errorText; String? errorText;
@ -557,7 +559,7 @@ Future<bool?> verificationCodeDialog(UserPayload? user) async {
username: user?.name, username: user?.name,
id: await bind.mainGetMyId(), id: await bind.mainGetMyId(),
uuid: await bind.mainGetUuid(), uuid: await bind.mainGetUuid(),
autoLogin: autoLogin, trustThisDevice: trustThisDevice,
type: HttpType.kAuthReqTypeEmailCode)); type: HttpType.kAuthReqTypeEmailCode));
switch (resp.type) { switch (resp.type) {
@ -605,6 +607,7 @@ Future<bool?> verificationCodeDialog(UserPayload? user) async {
focusNode: focusNode, focusNode: focusNode,
helperText: translate('verification_tip'), helperText: translate('verification_tip'),
), ),
/*
CheckboxListTile( CheckboxListTile(
contentPadding: const EdgeInsets.all(0), contentPadding: const EdgeInsets.all(0),
dense: true, dense: true,
@ -612,12 +615,13 @@ Future<bool?> verificationCodeDialog(UserPayload? user) async {
title: Row(children: [ title: Row(children: [
Expanded(child: Text(translate("Trust this device"))) Expanded(child: Text(translate("Trust this device")))
]), ]),
value: autoLogin, value: trustThisDevice,
onChanged: (v) { onChanged: (v) {
if (v == null) return; if (v == null) return;
setState(() => autoLogin = !autoLogin); setState(() => trustThisDevice = !trustThisDevice);
}, },
), ),
*/
Offstage( Offstage(
offstage: !isInProgress, offstage: !isInProgress,
child: const LinearProgressIndicator()), child: const LinearProgressIndicator()),

View File

@ -221,7 +221,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Remember me", "记住我"), ("Remember me", "记住我"),
("Trust this device", "信任此设备"), ("Trust this device", "信任此设备"),
("Verification code", "验证码"), ("Verification code", "验证码"),
("verification_tip", "检测到新设备登录,已向注册邮箱发送了登录验证码,请输入验证码继续登录"), ("verification_tip", "已向注册邮箱发送了登录验证码,请输入验证码继续登录"),
("Logout", "登出"), ("Logout", "登出"),
("Tags", "标签"), ("Tags", "标签"),
("Search ID", "查找 ID"), ("Search ID", "查找 ID"),

View File

@ -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"), ("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."), ("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!"), ("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."), ("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."), ("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."), ("request_elevation_tip", "You can also request elevation if there is someone on the remote side."),

View File

@ -221,7 +221,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Remember me", "記住我"), ("Remember me", "記住我"),
("Trust this device", "信任此裝置"), ("Trust this device", "信任此裝置"),
("Verification code", "驗證碼"), ("Verification code", "驗證碼"),
("verification_tip", "檢測到新裝置登入,已向註冊電子信箱發送了登入驗證碼,請輸入驗證碼以繼續登入"), ("verification_tip", "已向註冊電子信箱發送了登入驗證碼,請輸入驗證碼以繼續登入"),
("Logout", "登出"), ("Logout", "登出"),
("Tags", "標籤"), ("Tags", "標籤"),
("Search ID", "搜尋 ID"), ("Search ID", "搜尋 ID"),

View File

@ -1195,7 +1195,7 @@ function login() {
} }
abLoading = true; abLoading = true;
var url = handler.get_api_server(); 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) { if (data.error) {
abLoading = false; abLoading = false;
var err = translate(data.error); var err = translate(data.error);