synapse/handlers/auth.py
def _find_user_id_and_pwd_hash(self, user_id):
        """Checks to see if a user with the given id exists. Will check case
        insensitively, but will return None if there are multiple inexact
        matches.

        Returns:
            tuple: A 2-tuple of `(canonical_user_id, password_hash)`
            None: if there is not exactly one match
        """
        user_infos = yield self.store.get_users_by_id_case_insensitive(user_id)

        result = None
        if not user_infos:
            logger.warn("Attempted to login as %s but they do not exist", user_id)
        elif len(user_infos) == 1:
            # a single match (possibly not exact)
            result = user_infos.popitem()
        elif user_id in user_infos:
            # multiple matches, but one is exact
            result = (user_id, user_infos[user_id])
        else:
            # multiple matches, none of them exact
            logger.warn(
                "Attempted to login as %s but it matches more than one user "
                "inexactly: %r",
                user_id, user_infos.keys()
            )
        defer.returnValue(result)
Checks to see if a user with the given id exists. Will check case
        insensitively, but will return None if there are multiple inexact
        matches.

        Returns:
            tuple: A 2-tuple of `(canonical_user_id, password_hash)`
            None: if there is not exactly one match
        
Checks to see if a user with the given id exists. Will check case
insensitively, but will return None if there are multiple inexact
matches.
Checks to see if a user with the given id exists . Will check case insensitively but will return None if there are multiple inexact matches .
def _find_user_id_and_pwd_hash(self, user_id):
        user_infos = yield self.store.get_users_by_id_case_insensitive(user_id)
        result = None
        if not user_infos:
            logger.warn("Attempted to login as %s but they do not exist", user_id)
        elif len(user_infos) == 1:
            result = user_infos.popitem()
        elif user_id in user_infos:
            result = (user_id, user_infos[user_id])
        else:
            logger.warn(
                "Attempted to login as %s but it matches more than one user "
                "inexactly: %r",
                user_id, user_infos.keys()
            )
        defer.returnValue(result)
def _find_user_id_and_pwd_hash ( self , user_id ) : user_infos = yield self . store . get_users_by_id_case_insensitive ( user_id ) result = None if not user_infos : logger . warn ( "Attempted to login as %s but they do not exist" , user_id ) elif len ( user_infos ) == 1 : result = user_infos . popitem ( ) elif user_id in user_infos : result = ( user_id , user_infos [ user_id ] ) else : logger . warn ( "Attempted to login as %s but it matches more than one user " "inexactly: %r" , user_id , user_infos . keys ( ) ) defer . returnValue ( result )
Checks to see if a user with the given id exists.
Checks to see if a user with the given id exists .
"""Checks to see if a user with the given id exists. Will check case
        insensitively, but will return None if there are multiple inexact
        matches.

        Returns:
            tuple: A 2-tuple of `(canonical_user_id, password_hash)`
            None: if there is not exactly one match
        """ # a single match (possibly not exact) # multiple matches, but one is exact # multiple matches, none of them exact
A 2-tuple of `(canonical_user_id, password_hash)`
None: if there is not exactly one match
A 2 - tuple of ` ( canonical_user_id password_hash ) ` None : if there is not exactly one match
tuple
self
user_id