From 8aeb99483948b26f0136bbe1ed5b48b70d1f1853 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 13 Jun 2019 16:23:11 +0100 Subject: [PATCH] Expose the inhibit_login flag to register --- src/base-apis.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/base-apis.js b/src/base-apis.js index 6ef0b6ee9..9b56bcbad 100644 --- a/src/base-apis.js +++ b/src/base-apis.js @@ -151,13 +151,14 @@ MatrixBaseApis.prototype.isUsernameAvailable = function(username) { * threepid uses during registration in the ID server. Set 'msisdn' to * true to bind msisdn. * @param {string} guestAccessToken + * @param {string} inhibitLogin * @param {module:client.callback} callback Optional. * @return {module:client.Promise} Resolves: TODO * @return {module:http-api.MatrixError} Rejects: with an error response. */ MatrixBaseApis.prototype.register = function( username, password, - sessionId, auth, bindThreepids, guestAccessToken, + sessionId, auth, bindThreepids, guestAccessToken, inhibitLogin, callback, ) { // backwards compat @@ -166,6 +167,10 @@ MatrixBaseApis.prototype.register = function( } else if (bindThreepids === null || bindThreepids === undefined) { bindThreepids = {}; } + if (typeof inhibit_login === 'function') { + callback = inhibitLogin; + inhibitLogin = undefined; + } if (auth === undefined || auth === null) { auth = {}; @@ -192,6 +197,9 @@ MatrixBaseApis.prototype.register = function( if (guestAccessToken !== undefined && guestAccessToken !== null) { params.guest_access_token = guestAccessToken; } + if (inhibitLogin !== undefined && inhibitLogin !== null) { + params.inhibit_login = inhibitLogin; + } // Temporary parameter added to make the register endpoint advertise // msisdn flows. This exists because there are clients that break // when given stages they don't recognise. This parameter will cease