dddp/accounts/ddp.py
def login_with_password(self, params):
        """Authenticate using credentials supplied in params."""
        # never allow insecure login
        self.check_secure()

        username = self.get_username(params['user'])
        password = self.get_password(params['password'])

        user = auth.authenticate(username=username, password=password)
        if user is not None:
            # the password verified for the user
            if user.is_active:
                self.do_login(user)
                return get_user_token(
                    user=user, purpose=HashPurpose.RESUME_LOGIN,
                    minutes_valid=HASH_MINUTES_VALID[HashPurpose.RESUME_LOGIN],
                )

        # Call to `authenticate` couldn't verify the username and password.
        # It will have sent the `user_login_failed` signal, no need to pass the
        # `username` argument to auth_failed().
        self.auth_failed()
def login_with_password(self, params):
        """Authenticate using credentials supplied in params."""
        # never allow insecure login
        self.check_secure()

        username = self.get_username(params['user'])
        password = self.get_password(params['password'])

        user = auth.authenticate(username=username, password=password)
        if user is not None:
            # the password verified for the user
            if user.is_active:
                self.do_login(user)
                return get_user_token(
                    user=user, purpose=HashPurpose.RESUME_LOGIN,
                    minutes_valid=HASH_MINUTES_VALID[HashPurpose.RESUME_LOGIN],
                )

        # Call to `authenticate` couldn't verify the username and password.
        # It will have sent the `user_login_failed` signal, no need to pass the
        # `username` argument to auth_failed().
        self.auth_failed()
Authenticate using credentials supplied in params.