From 4230dfa5df9b0ff93e15e20b6dd5b067ff0b48dc Mon Sep 17 00:00:00 2001 From: Kaspars Dambis Date: Thu, 4 Oct 2018 11:13:56 +0300 Subject: [PATCH 1/2] Use native URL methods for appending the query params --- src/AuthenticationRequest.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/AuthenticationRequest.js b/src/AuthenticationRequest.js index ddac444..11c6aed 100644 --- a/src/AuthenticationRequest.js +++ b/src/AuthenticationRequest.js @@ -5,7 +5,6 @@ const assert = require('assert') const base64url = require('base64url') const crypto = require('@trust/webcrypto') const { JWT } = require('@solid/jose') -const FormUrlEncoded = require('./FormUrlEncoded') const { URL } = require('whatwg-url') /** @@ -117,7 +116,9 @@ class AuthenticationRequest { // render the request URI and terminate the algorithm .then(() => { let url = new URL(endpoint) - url.search = FormUrlEncoded.encode(params) + + // combine with any exists query parameters. + Object.entries(params).map((key, value) => url.searchParams.append(key, value)) return url.href }) From ba2bde9c9d8e2523ac65e7d008665cd2f94aa368 Mon Sep 17 00:00:00 2001 From: Kaspars Dambis Date: Thu, 4 Oct 2018 11:18:26 +0300 Subject: [PATCH 2/2] Fix reference --- src/AuthenticationRequest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AuthenticationRequest.js b/src/AuthenticationRequest.js index 11c6aed..de1913d 100644 --- a/src/AuthenticationRequest.js +++ b/src/AuthenticationRequest.js @@ -118,7 +118,7 @@ class AuthenticationRequest { let url = new URL(endpoint) // combine with any exists query parameters. - Object.entries(params).map((key, value) => url.searchParams.append(key, value)) + Object.entries(params).map(param => url.searchParams.append(param[0], param[1])) return url.href })