summary refs log tree commit diff
path: root/synapse/rest/client/v1
diff options
context:
space:
mode:
authorKent Shikama <kent@kentshikama.com>2016-07-03 15:08:15 +0900
committerKent Shikama <kent@kentshikama.com>2016-07-03 15:08:15 +0900
commitfc8007dbec40212ae85285aea600111ce2d06912 (patch)
treeaa732aedaf3a85455e56b0132e6d36033256191d /synapse/rest/client/v1
parentcode_style.rst: add link to sphinx examples (diff)
downloadsynapse-fc8007dbec40212ae85285aea600111ce2d06912.tar.xz
Optionally include password hash in createUser endpoint
Signed-off-by: Kent Shikama <kent@kentshikama.com>
Diffstat (limited to '')
-rw-r--r--synapse/rest/client/v1/register.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/rest/client/v1/register.py b/synapse/rest/client/v1/register.py
index e3f4fbb0bb..ef56d1e90f 100644
--- a/synapse/rest/client/v1/register.py
+++ b/synapse/rest/client/v1/register.py
@@ -410,12 +410,14 @@ class CreateUserRestServlet(ClientV1RestServlet):
             raise SynapseError(400, "Failed to parse 'duration_seconds'")
         if duration_seconds > self.direct_user_creation_max_duration:
             duration_seconds = self.direct_user_creation_max_duration
+        password_hash = user_json["password_hash"].encode("utf-8") if user_json["password_hash"] else None
 
         handler = self.handlers.registration_handler
         user_id, token = yield handler.get_or_create_user(
             localpart=localpart,
             displayname=displayname,
-            duration_seconds=duration_seconds
+            duration_seconds=duration_seconds,
+            password_hash=password_hash
         )
 
         defer.returnValue({