diff --git a/lib/base-apis.js b/lib/base-apis.js index c82301e3c..c53d4043f 100644 --- a/lib/base-apis.js +++ b/lib/base-apis.js @@ -290,6 +290,23 @@ MatrixBaseApis.prototype.deactivateAccount = function(auth, callback) { ); }; +/** + * Get the fallback URL to use for unknown interactive-auth stages. + * + * @param {string} loginType the type of stage being attempted + * @param {string} authSessionId the auth session ID provided by the homeserver + * + * @return {string} HS URL to hit to for the fallback interface + */ +MatrixBaseApis.prototype.getFallbackAuthUrl = function(loginType, authSessionId) { + var path = utils.encodeUri("/auth/$loginType/fallback/web", { + $loginType: loginType, + }); + + return this._http.getUrl(path, { + session: authSessionId, + }, httpApi.PREFIX_R0); +}; // Room operations // ===============