diff --git a/flutter/lib/common/hbbs/hbbs.dart b/flutter/lib/common/hbbs/hbbs.dart index 2ac72b3f8..d102d9f02 100644 --- a/flutter/lib/common/hbbs/hbbs.dart +++ b/flutter/lib/common/hbbs/hbbs.dart @@ -85,7 +85,7 @@ class LoginRequest { String? password; String? id; String? uuid; - bool? trustThisDevice; + bool? autoLogin; String? type; String? verificationCode; Map deviceInfo = DeviceInfo.toJson(); @@ -95,7 +95,7 @@ class LoginRequest { this.password, this.id, this.uuid, - this.trustThisDevice, + this.autoLogin, this.type, this.verificationCode}); @@ -105,7 +105,7 @@ class LoginRequest { if (password != null) data['password'] = password; if (id != null) data['id'] = id; if (uuid != null) data['uuid'] = uuid; - if (trustThisDevice != null) data['trustThisDevice'] = trustThisDevice; + if (autoLogin != null) data['autoLogin'] = autoLogin; if (type != null) data['type'] = type; if (verificationCode != null) { data['verificationCode'] = verificationCode; diff --git a/flutter/lib/common/widgets/login.dart b/flutter/lib/common/widgets/login.dart index 10960dc33..0818bcfd8 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(), - trustThisDevice: false, + autoLogin: true, type: HttpType.kAuthReqTypeAccount)); switch (resp.type) { @@ -531,7 +531,7 @@ Future loginDialog() async { } Future verificationCodeDialog(UserPayload? user) async { - var trustThisDevice = false; + var autoLogin = true; var isInProgress = false; String? errorText; @@ -564,7 +564,7 @@ Future verificationCodeDialog(UserPayload? user) async { username: user?.name, id: await bind.mainGetMyId(), uuid: await bind.mainGetUuid(), - trustThisDevice: trustThisDevice, + autoLogin: autoLogin, type: HttpType.kAuthReqTypeEmailCode)); switch (resp.type) { diff --git a/src/ui/common.tis b/src/ui/common.tis index c82fd62c3..320b4bf84 100644 --- a/src/ui/common.tis +++ b/src/ui/common.tis @@ -241,8 +241,8 @@ function msgbox(type, title, content, link="", callback=null, height=180, width= } var remember = false; try { remember = handler.get_remember(); } catch(e) {} - var auto_login = false; - try { auto_login = handler.get_option("auto-login") != ''; } catch(e) {} + var autoLogin = false; + try { autoLogin = handler.get_option("auto-login") != ''; } catch(e) {} width += is_xfce ? 50 : 0; height += is_xfce ? 50 : 0; @@ -297,7 +297,7 @@ function msgbox(type, title, content, link="", callback=null, height=180, width= }; } last_msgbox_tag = type + "-" + title + "-" + content + "-" + link; - $(#msgbox).content(); + $(#msgbox).content(); } function connecting() { diff --git a/src/ui/header.tis b/src/ui/header.tis index 00679f491..22b3ba1d0 100644 --- a/src/ui/header.tis +++ b/src/ui/header.tis @@ -82,7 +82,7 @@ function editOSPassword(login=false) { if (!res) return; var a0 = handler.get_option('auto-login') != ''; var p = (res.password || '').trim(); - var a = res.auto_login || false; + var a = res.autoLogin || false; if (p == p0 && a == a0) return; if (p != p0) handler.set_option('os-password', p); if (a != a0) handler.set_option('auto-login', a ? 'Y' : ''); diff --git a/src/ui/index.tis b/src/ui/index.tis index 1227ccddb..88833b887 100644 --- a/src/ui/index.tis +++ b/src/ui/index.tis @@ -1248,7 +1248,7 @@ function on_email_check(last_msg) { } abLoading = true; var url = handler.get_api_server(); - httpRequest(url + "/api/login", #post, {username: last_msg.user.name, id: my_id, uuid: handler.get_uuid(), type: 'email_code', trustThisDevice: false, verificationCode: code, deviceInfo: getDeviceInfo()}, + httpRequest(url + "/api/login", #post, {username: last_msg.user.name, id: my_id, uuid: handler.get_uuid(), type: 'email_code', autoLogin: true, verificationCode: code, deviceInfo: getDeviceInfo()}, function(data) { if (data.error) { abLoading = false; diff --git a/src/ui/msgbox.tis b/src/ui/msgbox.tis index 2099a8e7b..8d54bf22c 100644 --- a/src/ui/msgbox.tis +++ b/src/ui/msgbox.tis @@ -26,7 +26,7 @@ class MsgboxComponent: Reactor.Component { this.remember = params.remember; this.callback = params.callback; this.hasRetry = params.hasRetry; - this.auto_login = params.auto_login; + this.autoLogin = params.autoLogin; this.contentStyle = params.contentStyle; try { this.content = translate_text(this.content); } catch (e) {} } @@ -86,10 +86,10 @@ class MsgboxComponent: Reactor.Component { } else if (this.type == "session-login-password") { return this.getXsessionPasswordContent(); } else if (this.type == "custom-os-password") { - var ts = this.auto_login ? { checked: true } : {}; + var ts = this.autoLogin ? { checked: true } : {}; return
-
{translate('Auto Login')}
+
{translate('Auto Login')}
; } return this.content;