12033: Fix logging in from location with non-empty query string.
authorTom Clegg <tom@curoverse.com>
Fri, 11 Aug 2017 14:05:19 +0000 (10:05 -0400)
committerTom Clegg <tom@curoverse.com>
Fri, 11 Aug 2017 14:05:19 +0000 (10:05 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curoverse.com>

apps/workbench/app/assets/javascripts/models/session_db.js

index fde02f637a8ba6106d745bcb788c658363fae956..13d3eaffeed0b8ae74524f427c00004615de0ef7 100644 (file)
@@ -47,7 +47,7 @@ window.models.SessionDB = function() {
                 baseURL = 'https://' + baseURL
             if (!baseURL.endsWith('/'))
                 baseURL = baseURL + '/'
-            document.location = baseURL + 'login?return_to=' + encodeURIComponent(document.location.href+'?baseURL='+encodeURIComponent(baseURL))
+            document.location = baseURL + 'login?return_to=' + encodeURIComponent(document.location.href.replace(/\?.*/, '')+'?baseURL='+encodeURIComponent(baseURL))
             return false
         },
         checkForNewToken: function() {