diff options
author | David Baker <dave@matrix.org> | 2016-09-09 19:11:34 +0100 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2016-09-09 19:11:34 +0100 |
commit | b91e2833b3b59d6a8d104d8f6304383e68de2086 (patch) | |
tree | 4df820b06f89d7cb98ec6f75a99be4eebbd92ef6 /synapse/rest/client/v1/logout.py | |
parent | Add index to event_push_actions (diff) | |
parent | Merge pull request #1096 from matrix-org/markjh/get_access_token (diff) | |
download | synapse-b91e2833b3b59d6a8d104d8f6304383e68de2086.tar.xz |
Merge remote-tracking branch 'origin/develop' into dbkr/make_notif_highlight_query_fast
Diffstat (limited to 'synapse/rest/client/v1/logout.py')
-rw-r--r-- | synapse/rest/client/v1/logout.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/synapse/rest/client/v1/logout.py b/synapse/rest/client/v1/logout.py index 9bff02ee4e..1358d0acab 100644 --- a/synapse/rest/client/v1/logout.py +++ b/synapse/rest/client/v1/logout.py @@ -15,7 +15,7 @@ from twisted.internet import defer -from synapse.api.errors import AuthError, Codes +from synapse.api.auth import get_access_token_from_request from .base import ClientV1RestServlet, client_path_patterns @@ -37,13 +37,7 @@ class LogoutRestServlet(ClientV1RestServlet): @defer.inlineCallbacks def on_POST(self, request): - try: - access_token = request.args["access_token"][0] - except KeyError: - raise AuthError( - self.TOKEN_NOT_FOUND_HTTP_STATUS, "Missing access token.", - errcode=Codes.MISSING_TOKEN - ) + access_token = get_access_token_from_request(request) yield self.store.delete_access_token(access_token) defer.returnValue((200, {})) |