From 8d1fe4d033b0cac718121dc8229b716069d53cf9 Mon Sep 17 00:00:00 2001 From: Arnav Palnitkar Date: Wed, 11 May 2022 14:41:46 -0700 Subject: [PATCH] Remove unnecessary check for url encoding --- ui/app/routes/vault/cluster/oidc-callback.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/ui/app/routes/vault/cluster/oidc-callback.js b/ui/app/routes/vault/cluster/oidc-callback.js index 6bd992f8dcee..a3b413f5cb3e 100644 --- a/ui/app/routes/vault/cluster/oidc-callback.js +++ b/ui/app/routes/vault/cluster/oidc-callback.js @@ -6,11 +6,7 @@ export default Route.extend({ // left blank so we render the template immediately }, afterModel() { - let queryString = window.location.search; - // Check if url is encoded - if (this.containsEncodedComponents(queryString)) { - queryString = decodeURIComponent(queryString); - } + const queryString = decodeURIComponent(window.location.search); // Since state param can also contain namespace, fetch the values using native url api. // For instance, state params value can be state=st_123456,ns=d4fq // Ember paramsFor used to strip out the value after the "=" sign. In short ns value was not being passed along. @@ -28,8 +24,4 @@ export default Route.extend({ this._super(...arguments); controller.set('pageContainer', document.querySelector('.page-container')); }, - // Helper function to check if url is encoded - containsEncodedComponents(x) { - return decodeURI(x) !== decodeURIComponent(x); - }, });