diff --git a/lib/client.js b/lib/client.js index 7d0fe45bd..83165d545 100644 --- a/lib/client.js +++ b/lib/client.js @@ -2808,7 +2808,8 @@ MatrixClient.prototype.register = function(username, password, MatrixClient.prototype.requestRegisterEmailToken = function(email, clientSecret, sendAttempt, nextLink, callback) { return this._requestTokenFromEndpoint( - "/register/email/requestToken", email, clientSecret, sendAttempt, nextLink, callback + "/register/email/requestToken", + email, clientSecret, sendAttempt, nextLink, callback ); }; @@ -2825,12 +2826,18 @@ MatrixClient.prototype.requestRegisterEmailToken = function(email, clientSecret, * requestEmailToken calls the equivalent API directly on the ID server, * therefore bypassing the email addition specific logic. * - * Parameters and return value are as for requestEmailToken + * @param {string} email As requestEmailToken + * @param {string} clientSecret As requestEmailToken + * @param {number} sendAttempt As requestEmailToken + * @param {string} nextLink As requestEmailToken + * @param {module:client.callback} callback Optional. As requestEmailToken + * @return {module:client.Promise} Resolves: As requestEmailToken */ MatrixClient.prototype.request3pidAddEmailToken = function(email, clientSecret, sendAttempt, nextLink, callback) { return this._requestTokenFromEndpoint( - "/account/3pid/email/requestToken", email, clientSecret, sendAttempt, nextLink, callback + "/account/3pid/email/requestToken", + email, clientSecret, sendAttempt, nextLink, callback ); }; @@ -2846,18 +2853,32 @@ MatrixClient.prototype.request3pidAddEmailToken = function(email, clientSecret, * requestEmailToken calls the equivalent API directly on the ID server, * therefore bypassing the password reset specific logic. * - * Parameters and return value are as for requestEmailToken + * @param {string} email As requestEmailToken + * @param {string} clientSecret As requestEmailToken + * @param {number} sendAttempt As requestEmailToken + * @param {string} nextLink As requestEmailToken + * @param {module:client.callback} callback Optional. As requestEmailToken + * @return {module:client.Promise} Resolves: As requestEmailToken */ MatrixClient.prototype.requestPasswordEmailToken = function(email, clientSecret, sendAttempt, nextLink, callback) { return this._requestTokenFromEndpoint( - "/account/password/email/requestToken", email, clientSecret, sendAttempt, nextLink, callback + "/account/password/email/requestToken", + email, clientSecret, sendAttempt, nextLink, callback ); }; /** * Internal utility function for requesting validation tokens from usage-specific * requestToken endpoints. + * + * @param {string} endpoint The endpoint to send the request to + * @param {string} email As requestEmailToken + * @param {string} clientSecret As requestEmailToken + * @param {number} sendAttempt As requestEmailToken + * @param {string} nextLink As requestEmailToken + * @param {module:client.callback} callback Optional. As requestEmailToken + * @return {module:client.Promise} Resolves: As requestEmailToken */ MatrixClient.prototype._requestTokenFromEndpoint = function(endpoint, email, clientSecret,