Add pass through for token
This commit is contained in:
parent
9fe2fd04d4
commit
96bdc8dc09
|
|
@ -1005,7 +1005,12 @@ const UI = {
|
||||||
if (port) {
|
if (port) {
|
||||||
url += ':' + port;
|
url += ':' + port;
|
||||||
}
|
}
|
||||||
|
token = getQueryVar("token","nope");
|
||||||
|
if (token=="nope") {
|
||||||
url += '/' + path;
|
url += '/' + path;
|
||||||
|
} else {
|
||||||
|
url += '/' + path + '?token=' + token;
|
||||||
|
}
|
||||||
|
|
||||||
UI.rfb = new RFB(document.getElementById('noVNC_container'), url,
|
UI.rfb = new RFB(document.getElementById('noVNC_container'), url,
|
||||||
{ shared: UI.getSetting('shared'),
|
{ shared: UI.getSetting('shared'),
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,17 @@
|
||||||
document.getElementById('status').textContent = text;
|
document.getElementById('status').textContent = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getQueryVar(name, defVal) {
|
||||||
|
"use strict";
|
||||||
|
const re = new RegExp('.*[?&]' + name + '=([^&#]*)'),
|
||||||
|
match = document.location.href.match(re);
|
||||||
|
if (typeof defVal === 'undefined') { defVal = null; }
|
||||||
|
if (match) {
|
||||||
|
return decodeURIComponent(match[1]);
|
||||||
|
}
|
||||||
|
return defVal;
|
||||||
|
}
|
||||||
|
|
||||||
// This function extracts the value of one variable from the
|
// This function extracts the value of one variable from the
|
||||||
// query string. If the variable isn't defined in the URL
|
// query string. If the variable isn't defined in the URL
|
||||||
// it returns the default value instead.
|
// it returns the default value instead.
|
||||||
|
|
@ -171,7 +182,12 @@
|
||||||
if(port) {
|
if(port) {
|
||||||
url += ':' + port;
|
url += ':' + port;
|
||||||
}
|
}
|
||||||
|
token = getQueryVar("token","nope");
|
||||||
|
if (token=="nope") {
|
||||||
url += '/' + path;
|
url += '/' + path;
|
||||||
|
} else {
|
||||||
|
url += '/' + path + '?token=' + token;
|
||||||
|
}
|
||||||
|
|
||||||
// Creating a new RFB object will start a new connection
|
// Creating a new RFB object will start a new connection
|
||||||
rfb = new RFB(document.getElementById('screen'), url,
|
rfb = new RFB(document.getElementById('screen'), url,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue