1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00
This commit is contained in:
David Baker
2019-07-10 10:43:54 +01:00
parent e9528ebb98
commit 524fea1297

View File

@@ -32,9 +32,9 @@ const utils = require("./utils");
function termsUrlForService(serviceType, baseUrl) { function termsUrlForService(serviceType, baseUrl) {
switch (serviceType) { switch (serviceType) {
case SERVICETYPES.IS: case SERVICETYPES.IS:
return baseUrl + httpApi.PREFIX_IDENTITY_V2 return baseUrl + httpApi.PREFIX_IDENTITY_V2;
case SERVICETYPES.IM: case SERVICETYPES.IM:
return baseUrl + '/terms/' return baseUrl + '/terms/';
default: default:
throw new Error('Unsupported service type'); throw new Error('Unsupported service type');
} }
@@ -1909,7 +1909,9 @@ MatrixBaseApis.prototype.getTerms = function(serviceType, baseUrl, accessToken)
); );
}; };
MatrixBaseApis.prototype.agreeToTerms = function(serviceType, baseUrl, accessToken, termsUrls) { MatrixBaseApis.prototype.agreeToTerms = function(
serviceType, baseUrl, accessToken, termsUrls,
) {
const url = termsUrlForService(serviceType, baseUrl); const url = termsUrlForService(serviceType, baseUrl);
const headers = { const headers = {
Authorization: "Bearer " + accessToken, Authorization: "Bearer " + accessToken,