fix check for failed authentication

This commit is contained in:
Christoph Witzany 2016-04-06 18:30:11 +02:00
parent 9c62fcdb68
commit ed4d18f516

View File

@ -230,7 +230,9 @@ class AuthHandler(BaseHandler):
if not user_id.startswith('@'):
user_id = UserID.create(user_id, self.hs.hostname).to_string()
self._check_password(user_id, password)
if not (yield self._check_password(user_id, password)):
logger.warn("Failed password login for user %s", user_id)
raise LoginError(403, "", errcode=Codes.FORBIDDEN)
defer.returnValue(user_id)
@ -356,7 +358,7 @@ class AuthHandler(BaseHandler):
LoginError if there was an authentication problem.
"""
if not self._check_password(user_id, password):
if not (yield self._check_password(user_id, password)):
logger.warn("Failed password login for user %s", user_id)
raise LoginError(403, "", errcode=Codes.FORBIDDEN)