frontend/js/common/util/parse_query.js
Paulus Schoutsen 3b7a206cec
Add an authorize page for authentication (#1147)
* Use authorize page if auth provider

* Add webcomponent polyfill

* More fixes

* ES5 fix

* Lint

* Use redirect_uri

* upgrade uglify to fix tests?

* Update browsers used for testing
2018-05-10 14:25:36 -04:00

12 lines
359 B
JavaScript

export default function parseQuery(queryString) {
const query = {};
const items = queryString.split('&');
for (let i = 0; i < items.length; i++) {
const item = items[i].split('=');
const key = decodeURIComponent(item[0]);
const value = item.length > 1 ? decodeURIComponent(item[1]) : undefined;
query[key] = value;
}
return query;
}