}
var trySendToken = function() {
+ var token = urlParams.get('token');
+ if (token) {
+ history.replaceState(null, "", `/webshell/?host=${encodeURIComponent(urlParams.get('host'))}&login=${encodeURIComponent(urlParams.get('login'))}`)
+ } else if (localStorage.getItem('apiToken')) {
+ token = localStorage.getItem('apiToken');
+ } else {
+ // No token
+ }
// change this text when PAM is reconfigured to present a
// password prompt that we can wait for.
- var token = urlParams.get('token');
if (findText("assword:")) {
sh.keysPressed(token + "\n");
sh.vt100('(sent authentication token)\n');
+ token = null;
} else {
setTimeout(trySendToken, 200);
}