diff options
author | David Baker <dbkr@matrix.org> | 2014-09-03 18:23:56 +0100 |
---|---|---|
committer | David Baker <dbkr@matrix.org> | 2014-09-03 18:23:56 +0100 |
commit | a25d1530ef9f48e5853ee735674d8e2251a8cbb0 (patch) | |
tree | 6260c381c4d9d69b678db2e5f7d151e5a606ae5f /webclient/components | |
parent | Add support for registering with a threepid to the HS (get credentials from t... (diff) | |
download | synapse-a25d1530ef9f48e5853ee735674d8e2251a8cbb0.tar.xz |
Make registering and logging in with a threepid work in the webclient.
Diffstat (limited to 'webclient/components')
-rw-r--r-- | webclient/components/matrix/matrix-service.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/webclient/components/matrix/matrix-service.js b/webclient/components/matrix/matrix-service.js index 2ae55bea9f..d399aa3cb9 100644 --- a/webclient/components/matrix/matrix-service.js +++ b/webclient/components/matrix/matrix-service.js @@ -84,13 +84,14 @@ angular.module('matrixService', []) prefix: prefixPath, // Register an user - register: function(user_name, password) { + register: function(user_name, password, threepidCreds) { // The REST path spec var path = "/register"; return doRequest("POST", path, undefined, { user_id: user_name, - password: password + password: password, + threepidCreds: threepidCreds }); }, @@ -315,9 +316,9 @@ angular.module('matrixService', []) return doBaseRequest(config.identityServer, "POST", path, {}, data, headers); }, - authEmail: function(clientSecret, tokenId, code) { + authEmail: function(clientSecret, sid, code) { var path = "/_matrix/identity/api/v1/validate/email/submitToken"; - var data = "token="+code+"&sid="+tokenId+"&clientSecret="+clientSecret; + var data = "token="+code+"&sid="+sid+"&clientSecret="+clientSecret; var headers = {}; headers["Content-Type"] = "application/x-www-form-urlencoded"; return doBaseRequest(config.identityServer, "POST", path, {}, data, headers); @@ -330,6 +331,11 @@ angular.module('matrixService', []) headers["Content-Type"] = "application/x-www-form-urlencoded"; return doBaseRequest(config.identityServer, "POST", path, {}, data, headers); }, + + lookup3pid: function(medium, address) { + var path = "/_matrix/identity/api/v1/lookup?medium="+encodeURIComponent(medium)+"&address="+encodeURIComponent(address); + return doBaseRequest(config.identityServer, "GET", path, {}, undefined, {}); + }, uploadContent: function(file) { var path = "/_matrix/content"; |