summary refs log tree commit diff
path: root/synapse/rest/client/v1/logout.py
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2020-05-14 16:32:49 +0100
committerGitHub <noreply@github.com>2020-05-14 16:32:49 +0100
commit225c16508705ecfdde44e3c90060609fab020e32 (patch)
tree4c09fa8042b0fd6fae0fb626e825bc4a4bcc58d2 /synapse/rest/client/v1/logout.py
parentMove EventStream handling into default ReplicationDataHandler (#7493) (diff)
downloadsynapse-225c16508705ecfdde44e3c90060609fab020e32.tar.xz
Allow expired accounts to logout (#7443)
Diffstat (limited to 'synapse/rest/client/v1/logout.py')
-rw-r--r--synapse/rest/client/v1/logout.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/rest/client/v1/logout.py b/synapse/rest/client/v1/logout.py
index 1cf3caf832..b0c30b65be 100644
--- a/synapse/rest/client/v1/logout.py
+++ b/synapse/rest/client/v1/logout.py
@@ -34,10 +34,10 @@ class LogoutRestServlet(RestServlet):
         return 200, {}
 
     async def on_POST(self, request):
-        requester = await self.auth.get_user_by_req(request)
+        requester = await self.auth.get_user_by_req(request, allow_expired=True)
 
         if requester.device_id is None:
-            # the acccess token wasn't associated with a device.
+            # The access token wasn't associated with a device.
             # Just delete the access token
             access_token = self.auth.get_access_token_from_request(request)
             await self._auth_handler.delete_access_token(access_token)
@@ -62,7 +62,7 @@ class LogoutAllRestServlet(RestServlet):
         return 200, {}
 
     async def on_POST(self, request):
-        requester = await self.auth.get_user_by_req(request)
+        requester = await self.auth.get_user_by_req(request, allow_expired=True)
         user_id = requester.user.to_string()
 
         # first delete all of the user's devices