1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-17 21:42:17 +03:00

Merge pull request #224 from matrix-org/rav/auth_fallback_url

Function to get the fallback url for interactive auth
This commit is contained in:
David Baker
2016-10-07 15:41:13 +01:00
committed by GitHub

View File

@@ -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
// ===============