17229: Clear webshell token from url after page loads
[arvados-workbench2.git] / public / webshell / index.html
index 6fa6f313a965b82531dd2a9a6b280ac2d7d64d0c..77800137517d72fe74d2a31428032719c38c3184 100644 (file)
         }
 
         var trySendToken = function() {
+          var token = urlParams.get('token');
+          if (token) {
+            history.replaceState(null, "", `/webshell/?host=${encodeURIComponent(urlParams.get('host'))}&login=${encodeURIComponent(urlParams.get('login'))}`)
+          }
           // 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');