17229: Clear webshell token from url after page loads
authorStephen Smith <stephen@curii.com>
Thu, 16 Sep 2021 19:04:21 +0000 (15:04 -0400)
committerStephen Smith <stephen@curii.com>
Thu, 16 Sep 2021 19:04:21 +0000 (15:04 -0400)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

public/webshell/index.html

index 6fa6f313a965b82531dd2a9a6b280ac2d7d64d0c..77800137517d72fe74d2a31428032719c38c3184 100644 (file)
         }
 
         var trySendToken = function() {
         }
 
         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.
           // 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');
           if (findText("assword:")) {
              sh.keysPressed(token + "\n");
              sh.vt100('(sent authentication token)\n');