summary refs log tree commit diff
diff options
context:
space:
mode:
authorTravis Ralston <travpc@gmail.com>2019-07-03 14:53:22 -0600
committerTravis Ralston <travpc@gmail.com>2019-07-03 14:53:22 -0600
commitb1f2078ef179a1bffc9cac9af00fffae0aff88a1 (patch)
treedcc70fbc65a799c0302dbfc206fc67a97fce4221
parentDon't cache access tokens (diff)
downloadsynapse-travis/fake-soft-logout.tar.xz
-rw-r--r--synapse/api/auth.py2
-rw-r--r--synapse/api/errors.py9
2 files changed, 6 insertions, 5 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index f5a7ee4576..9ade160269 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -525,7 +525,7 @@ class Auth(object):
                 401,
                 "Token soft logged out",
                 errcode=Codes.UNKNOWN_TOKEN,
-                softLogout=True,
+                soft_logout=True,
             )
 
         # we use ret.get() below because *lots* of unit tests stub out
diff --git a/synapse/api/errors.py b/synapse/api/errors.py
index 6d88fda38b..091019ebd5 100644
--- a/synapse/api/errors.py
+++ b/synapse/api/errors.py
@@ -85,7 +85,7 @@ class SynapseError(CodeMessageException):
         errcode (str): Matrix error code e.g 'M_FORBIDDEN'
     """
 
-    def __init__(self, code, msg, errcode=Codes.UNKNOWN, softLogout=False):
+    def __init__(self, code, msg, errcode=Codes.UNKNOWN, soft_logout=False):
         """Constructs a synapse error.
 
         Args:
@@ -95,9 +95,10 @@ class SynapseError(CodeMessageException):
         """
         super(SynapseError, self).__init__(code, msg)
         self.errcode = errcode
+        self.soft_logout = soft_logout
 
     def error_dict(self):
-        return cs_error(self.msg, self.errcode, self.softLogout)
+        return cs_error(self.msg, self.errcode, self.soft_logout)
 
 
 class ProxiedRequestError(SynapseError):
@@ -383,7 +384,7 @@ class RequestSendFailed(RuntimeError):
         self.can_retry = can_retry
 
 
-def cs_error(msg, code=Codes.UNKNOWN, softLogout=False, **kwargs):
+def cs_error(msg, code=Codes.UNKNOWN, soft_logout=False, **kwargs):
     """ Utility method for constructing an error response for client-server
     interactions.
 
@@ -394,7 +395,7 @@ def cs_error(msg, code=Codes.UNKNOWN, softLogout=False, **kwargs):
     Returns:
         A dict representing the error response JSON.
     """
-    err = {"error": msg, "errcode": code, "soft_logout": softLogout}
+    err = {"error": msg, "errcode": code, "soft_logout": soft_logout}
     for key, value in iteritems(kwargs):
         err[key] = value
     return err