update: login system: do not send tellyscript nor login headers to reconnecting (eg client:redial) client
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
var gourl = "wtv-head-waiter:/login?";
|
||||
if (request_headers.query.relogin) gourl += "relogin=true";
|
||||
if (request_headers.query.reconnect) gourl += "reconnect=true";
|
||||
|
||||
if (socket.ssid) {
|
||||
if (ssid_sessions[socket.ssid].data_store) {
|
||||
@@ -46,7 +47,7 @@ if (ssid_sessions[socket.ssid].data_store.wtvsec_login) {
|
||||
var send_tellyscripts = (minisrv_config.services[service_name].send_tellyscripts && !request_headers.query.relogin);
|
||||
var wtv_script_id = parseInt(ssid_sessions[socket.ssid].get("wtv-script-id"));
|
||||
var bootrom = ssid_sessions[socket.ssid].get("wtv-client-bootrom-version");
|
||||
if (request_headers.query.relogin && wtv_script_id != 0) send_tellyscripts = false;
|
||||
if ((request_headers.query.reconnect || request_headers.query.relogin) && wtv_script_id != 0) send_tellyscripts = false;
|
||||
if (send_tellyscripts) {
|
||||
if (minisrv_config.services[service_name].send_tellyscript_ssid_whitelist) {
|
||||
var send_telly_to_ssid = (minisrv_config.services[service_name].send_tellyscript_ssid_whitelist.findIndex(element => element == socket.ssid) != -1)
|
||||
@@ -101,10 +102,14 @@ if (ssid_sessions[socket.ssid].data_store.wtvsec_login) {
|
||||
ssid_sessions[socket.ssid].set("bf0app_update", bf0app_update);
|
||||
}
|
||||
|
||||
if (request_headers["wtv-ticket"]) {
|
||||
if (request_headers["wtv-ticket"] && !request_headers.query.reconnect) {
|
||||
gourl = "wtv-head-waiter:/login-stage-two?relogin=true";
|
||||
}
|
||||
|
||||
if (request_headers.query.reconnect) {
|
||||
gourl = null;
|
||||
}
|
||||
|
||||
|
||||
if (!file_path != null && !zquiet) console.log(" * Sending TellyScript", file_path, "on socket", socket.id);
|
||||
|
||||
@@ -125,7 +130,7 @@ if (ssid_sessions[socket.ssid].data_store.wtvsec_login) {
|
||||
headers += getServiceString('wtv-flashrom') + "\n";
|
||||
if (bf0app_update) headers += "wtv-boot-url: " + gourl + "\n";
|
||||
else headers += "wtv-boot-url: wtv-1800:/preregister?relogin=true\n";
|
||||
headers += "wtv-visit: " + gourl + "\n";
|
||||
if (gourl != null) headers += "wtv-visit: " + gourl + "\n";
|
||||
if (!bf0app_update && ssid_sessions[socket.ssid].get("wtv-open-access")) headers += "wtv-open-isp-disabled: false\n";
|
||||
headers += "wtv-client-time-zone: GMT -0000\n";
|
||||
headers += "wtv-client-time-dst-rule: GMT\n"
|
||||
|
||||
@@ -96,7 +96,7 @@ wtv-wink-deferrer-retries: 3
|
||||
wtv-offline-mail-enable: false
|
||||
wtv-name-server: 8.8.8.8
|
||||
`;
|
||||
if (ssid_sessions[socket.ssid].get('wtv-need-upgrade') != 'true') {
|
||||
if (ssid_sessions[socket.ssid].get('wtv-need-upgrade') != 'true' && !request_headers.query.reconnect) {
|
||||
headers += "wtv-settings-url: wtv-setup:/get\n";
|
||||
}
|
||||
headers += `wtv-visit: wtv-home:/splash?
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
var challenge_response, challenge_header = '';
|
||||
|
||||
var gourl = "wtv-head-waiter:/login-stage-two?";
|
||||
if (request_headers.query.relogin) gourl += "relogin=true";
|
||||
if (request_headers.query.reconnect) gourl += "reconnect=true";
|
||||
|
||||
if (socket.ssid !== null) {
|
||||
var wtvsec_login = ssid_sessions[socket.ssid].get("wtvsec_login");
|
||||
if (request_headers["wtv-ticket"]) {
|
||||
@@ -56,10 +60,10 @@ Expires: Wed, 09 Oct 1991 22:00:00 GMT
|
||||
wtv-expire-all: wtv-head-waiter:
|
||||
`+ getServiceString('wtv-log') + `
|
||||
wtv-log-url: wtv-log:/log
|
||||
`+ challenge_header + `
|
||||
${challenge_header}
|
||||
wtv-relogin-url: wtv-1800:/preregister?relogin=true
|
||||
wtv-reconnect-url: wtv-1800:/preregister?reconnect=true
|
||||
wtv-visit: wtv-head-waiter:/login-stage-two?
|
||||
wtv-visit: ${gourl}
|
||||
Content-type: text/html`;
|
||||
data = '';
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user