summary refs log tree commit diff
path: root/synapse/handlers/login.py
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-08-14 14:29:01 +0100
committerKegan Dougal <kegan@matrix.org>2014-08-14 14:29:06 +0100
commit5a5f37ca17fdee8149ec0f6ce78f83259ed9d530 (patch)
tree3f327487cfadad7a1dd4198e3b4730e47dd155fa /synapse/handlers/login.py
parentRound Presence mtime and mtime_age to nearest msec; avoids floats for msec va... (diff)
downloadsynapse-5a5f37ca17fdee8149ec0f6ce78f83259ed9d530.tar.xz
Send forbidden codes when doing login attempts.
Diffstat (limited to '')
-rw-r--r--synapse/handlers/login.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/handlers/login.py b/synapse/handlers/login.py
index ca69829d77..0220fa0604 100644
--- a/synapse/handlers/login.py
+++ b/synapse/handlers/login.py
@@ -16,7 +16,7 @@
 from twisted.internet import defer
 
 from ._base import BaseHandler
-from synapse.api.errors import LoginError
+from synapse.api.errors import LoginError, Codes
 
 import bcrypt
 import logging
@@ -51,7 +51,7 @@ class LoginHandler(BaseHandler):
         user_info = yield self.store.get_user_by_id(user_id=user)
         if not user_info:
             logger.warn("Attempted to login as %s but they do not exist.", user)
-            raise LoginError(403, "")
+            raise LoginError(403, "", errcode=Codes.FORBIDDEN)
 
         stored_hash = user_info[0]["password_hash"]
         if bcrypt.checkpw(password, stored_hash):
@@ -62,4 +62,4 @@ class LoginHandler(BaseHandler):
             defer.returnValue(token)
         else:
             logger.warn("Failed password login for user %s", user)
-            raise LoginError(403, "")
\ No newline at end of file
+            raise LoginError(403, "", errcode=Codes.FORBIDDEN)
\ No newline at end of file