summary refs log tree commit diff
path: root/synapse/rest/client/v1
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2017-10-31 15:15:51 +0000
committerRichard van der Hoff <richard@matrix.org>2017-11-01 16:51:03 +0000
commit4c8f94ac9433753464c4d8379aae650c3129500d (patch)
tree228d1c3f47728b8f8f8fbfe4f15090f5abeb04d9 /synapse/rest/client/v1
parentMerge pull request #2620 from matrix-org/rav/auth_non_password (diff)
downloadsynapse-4c8f94ac9433753464c4d8379aae650c3129500d.tar.xz
Allow password_auth_providers to return a callback
... so that they have a way to record access tokens.
Diffstat (limited to 'synapse/rest/client/v1')
-rw-r--r--synapse/rest/client/v1/login.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/rest/client/v1/login.py b/synapse/rest/client/v1/login.py
index d25a68e753..5669ecb724 100644
--- a/synapse/rest/client/v1/login.py
+++ b/synapse/rest/client/v1/login.py
@@ -219,7 +219,7 @@ class LoginRestServlet(ClientV1RestServlet):
             raise SynapseError(400, "User identifier is missing 'user' key")
 
         auth_handler = self.auth_handler
-        canonical_user_id = yield auth_handler.validate_login(
+        canonical_user_id, callback = yield auth_handler.validate_login(
             identifier["user"],
             login_submission,
         )
@@ -238,6 +238,9 @@ class LoginRestServlet(ClientV1RestServlet):
             "device_id": device_id,
         }
 
+        if callback is not None:
+            yield callback(result)
+
         defer.returnValue((200, result))
 
     @defer.inlineCallbacks