Password reset, finally.

This commit is contained in:
David Baker 2015-04-17 19:53:47 +01:00
parent 117f35ac4a
commit 8db6832db8
3 changed files with 38 additions and 7 deletions

View file

@ -195,12 +195,18 @@ class AuthHandler(BaseHandler):
def _check_email_identity(self, authdict, _):
yield run_on_reactor()
if 'threepidCreds' not in authdict:
raise LoginError(400, "Missing threepidCreds", Codes.MISSING_PARAM)
threepidCreds = authdict['threepidCreds']
identity_handler = self.hs.get_handlers().identity_handler
logger.debug("Getting validated threepid. threepidcreds: %r" % (threepidCreds,))
logger.info("Getting validated threepid. threepidcreds: %r" % (threepidCreds,))
threepid = yield identity_handler.threepid_from_creds(threepidCreds)
if not threepid:
raise LoginError(401, "", errcode=Codes.UNAUTHORIZED)
threepid['threepidCreds'] = authdict['threepidCreds']
defer.returnValue(threepid)