public function login(Listener $listener, array $input, ThrottlesCommand $throttles = null)
    {
        $validation = $this->validator->on('login')->with($input);

        // Validate user login, if any errors is found redirect it back to
        // login page with the errors.
        if ($validation->fails()) {
            return $listener->userLoginHasFailedValidation($validation->getMessageBag());
        }

        if ($this->hasTooManyAttempts($throttles)) {
            return $this->handleUserHasTooManyAttempts($listener, $input, $throttles);
        }

        if ($this->authenticate($input)) {
            return $this->handleUserWasAuthenticated($listener, $input, $throttles);
        }

        return $this->handleUserFailedAuthentication($listener, $input, $throttles);
    }