X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/8faf40308b6ff0e78029a474276cbe9381ee9498..09aa4af1e7131950cfe52b702d8a1dde3b473d55:/public/webshell/index.html?ds=sidebyside diff --git a/public/webshell/index.html b/public/webshell/index.html index 6fa6f313..3f25aed5 100644 --- a/public/webshell/index.html +++ b/public/webshell/index.html @@ -40,12 +40,20 @@ } 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); }