autoLogin and trustThisDevice are two different things

This commit is contained in:
rustdesk
2023-06-22 22:11:35 +08:00
parent 52f3ab0852
commit ac8fc71b3b
6 changed files with 14 additions and 14 deletions

View File

@@ -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(<MsgboxComponent width={width} height={height} auto_login={auto_login} type={type} title={title} content={content} link={link} remember={remember} callback={callback} contentStyle={contentStyle} hasRetry={hasRetry} />);
$(#msgbox).content(<MsgboxComponent width={width} height={height} autoLogin={autoLogin} type={type} title={title} content={content} link={link} remember={remember} callback={callback} contentStyle={contentStyle} hasRetry={hasRetry} />);
}
function connecting() {

View File

@@ -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' : '');

View File

@@ -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;

View File

@@ -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 <div .form>
<PasswordComponent value={this.content} />
<div><button|checkbox(auto_login) {ts} style="width: *; word-wrap: break-word; overflow-wrap: break-word; white-space: normal; height: auto; overflow: hidden;">{translate('Auto Login')}</button></div>
<div><button|checkbox(autoLogin) {ts} style="width: *; word-wrap: break-word; overflow-wrap: break-word; white-space: normal; height: auto; overflow: hidden;">{translate('Auto Login')}</button></div>
</div>;
}
return this.content;