Allow password_auth_providers to return a callback

... so that they have a way to record access tokens.
This commit is contained in:
Richard van der Hoff 2017-10-31 15:15:51 +00:00
parent 846a94fbc9
commit 4c8f94ac94
3 changed files with 17 additions and 6 deletions

View file

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