Skip to content

Commit 50af835

Browse files
author
Crhistian Ramirez
committed
fix: url encode special characters on auth methods
1 parent e515c57 commit 50af835

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/api/Auth.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
throw new Error("Missing the required parameter 'scope' when calling Login");
6868
}
6969

70-
var postBody = 'grant_type=password&scope=' + this.sdk.buildCollectionParam(scope, 'plus') + '&client_id=' + clientID + '&username=' + username + '&password=' + password;
70+
var postBody = 'grant_type=password&scope=' + this.sdk.buildCollectionParam(scope, 'plus') + '&client_id=' + clientID + '&username=' + encodeURIComponent(username) + '&password=' + encodeURIComponent(password);
7171

7272
var pathParams = {};
7373
var queryParams = {};
@@ -113,7 +113,7 @@
113113
throw new Error("Missing the required parameter 'scope' when calling ElevatedLogin");
114114
}
115115

116-
var postBody = 'grant_type=password&scope=' + this.sdk.buildCollectionParam(scope, 'plus') + '&client_secret=' + clientSecret + '&client_id=' + clientID + '&username=' + username + '&password=' + password;
116+
var postBody = 'grant_type=password&scope=' + this.sdk.buildCollectionParam(scope, 'plus') + '&client_secret=' + clientSecret + '&client_id=' + clientID + '&username=' + encodeURIComponent(username) + '&password=' + encodeURIComponent(password);
117117

118118
var pathParams = {};
119119
var queryParams = {};

0 commit comments

Comments
 (0)