Skip to content

Commit

Permalink
Merge pull request #233 from matrix-org/dbkr/register_dont_replace_pa…
Browse files Browse the repository at this point in the history
…rams

Fix params getting replaced on register calls
  • Loading branch information
dbkr committed Oct 11, 2016
2 parents 6218bad + d3db4ee commit 4e2483b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/base-apis.js
Expand Up @@ -136,10 +136,12 @@ MatrixBaseApis.prototype.register = function(
var params = {
auth: auth
};
if (username !== undefined) { params.username = username; }
if (password !== undefined) { params.password = password; }
if (bindEmail !== undefined) { params.bind_email = bindEmail; }
if (guestAccessToken !== undefined) { params.guest_access_token = guestAccessToken; }
if (username !== undefined && username !== null) { params.username = username; }
if (password !== undefined && password !== null) { params.password = password; }
if (bindEmail !== undefined && bindEmail !== null) { params.bind_email = bindEmail; }
if (guestAccessToken !== undefined && guestAccessToken !== null) {
params.guest_access_token = guestAccessToken;
}

return this.registerRequest(params, undefined, callback);
};
Expand Down

0 comments on commit 4e2483b

Please sign in to comment.