summary refs log tree commit diff
path: root/synapse/rest/client/v1/login.py
diff options
context:
space:
mode:
authorDaniel Wagner-Hall <daniel@matrix.org>2015-08-20 16:21:35 +0100
committerDaniel Wagner-Hall <daniel@matrix.org>2015-08-20 16:21:35 +0100
commitcecbd636e94f4e900ef6d246b62698ff1c8ee352 (patch)
treeb5a53e2a02201cd37ea33090c630865f593c19bd /synapse/rest/client/v1/login.py
parents/by_token/by_access_token/g (diff)
downloadsynapse-cecbd636e94f4e900ef6d246b62698ff1c8ee352.tar.xz
/tokenrefresh POST endpoint
This allows refresh tokens to be exchanged for (access_token,
refresh_token).

It also starts issuing them on login, though no clients currently
interpret them.
Diffstat (limited to 'synapse/rest/client/v1/login.py')
-rw-r--r--synapse/rest/client/v1/login.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/rest/client/v1/login.py b/synapse/rest/client/v1/login.py
index 694072693d..b963a38618 100644
--- a/synapse/rest/client/v1/login.py
+++ b/synapse/rest/client/v1/login.py
@@ -78,13 +78,15 @@ class LoginRestServlet(ClientV1RestServlet):
             login_submission["user"] = UserID.create(
                 login_submission["user"], self.hs.hostname).to_string()
 
-        token = yield self.handlers.auth_handler.login_with_password(
+        auth_handler = self.handlers.auth_handler
+        access_token, refresh_token = yield auth_handler.login_with_password(
             user_id=login_submission["user"],
             password=login_submission["password"])
 
         result = {
             "user_id": login_submission["user"],  # may have changed
-            "access_token": token,
+            "access_token": access_token,
+            "refresh_token": refresh_token,
             "home_server": self.hs.hostname,
         }