Skip to content

Commit

Permalink
Remove unnecessary check for url encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
arnav28 committed May 12, 2022
1 parent ddbe120 commit 8d1fe4d
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions ui/app/routes/vault/cluster/oidc-callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);
},
});

0 comments on commit 8d1fe4d

Please sign in to comment.