mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Merge pull request #732 from matrix-org/erikj/login
Simplify _check_password
This commit is contained in:
commit
3727a15764
@ -432,11 +432,15 @@ class AuthHandler(BaseHandler):
|
|||||||
Returns:
|
Returns:
|
||||||
True if the user_id successfully authenticated
|
True if the user_id successfully authenticated
|
||||||
"""
|
"""
|
||||||
defer.returnValue((
|
valid_ldap = yield self._check_ldap_password(user_id, password)
|
||||||
(yield self._check_ldap_password(user_id, password))
|
if valid_ldap:
|
||||||
or
|
defer.returnValue(True)
|
||||||
(yield self._check_local_password(user_id, password))
|
|
||||||
))
|
valid_local_password = yield self._check_local_password(user_id, password)
|
||||||
|
if valid_local_password:
|
||||||
|
defer.returnValue(True)
|
||||||
|
|
||||||
|
defer.returnValue(False)
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def _check_local_password(self, user_id, password):
|
def _check_local_password(self, user_id, password):
|
||||||
|
Loading…
Reference in New Issue
Block a user