public function auth(LoginForm $form): User
    {
        $this->checkFailure();
        $user = $this->user->findByUsernameOrEmail($form->username);
        if (!$user || !$user->validatePassword($form->password)) {
            $this->setFailure();
            throw new \DomainException($this->i18n->t('setrun/user', 'Wrong Username or Password'));
        }
        if ($user && $user->status == User::STATUS_BLOCKED) {
            throw new \DomainException($this->i18n->t('setrun/user', 'Account temporarily blocked'));
        }
        if ($user && $user->status == User::STATUS_WAIT) {
            throw new \DomainException($this->i18n->t('setrun/user', 'Account not confirmed'));
        }
        $this->removeFailure();
        return $user;
    }
public function auth(LoginForm $form): User
    {
        $this->checkFailure();
        $user = $this->user->findByUsernameOrEmail($form->username);
        if (!$user || !$user->validatePassword($form->password)) {
            $this->setFailure();
            throw new \DomainException($this->i18n->t('setrun/user', 'Wrong Username or Password'));
        }
        if ($user && $user->status == User::STATUS_BLOCKED) {
            throw new \DomainException($this->i18n->t('setrun/user', 'Account temporarily blocked'));
        }
        if ($user && $user->status == User::STATUS_WAIT) {
            throw new \DomainException($this->i18n->t('setrun/user', 'Account not confirmed'));
        }
        $this->removeFailure();
        return $user;
    }
public function auth ( LoginForm $ form ) : User { $ this -> checkFailure ( ) ; $ user = $ this -> user -> findByUsernameOrEmail ( $ form -> username ) ; if ( ! $ user || ! $ user -> validatePassword ( $ form -> password ) ) { $ this -> setFailure ( ) ; throw new \ DomainException ( $ this -> i18n -> t ( 'setrun/user' , 'Wrong Username or Password' ) ) ; } if ( $ user && $ user -> status == User :: STATUS_BLOCKED ) { throw new \ DomainException ( $ this -> i18n -> t ( 'setrun/user' , 'Account temporarily blocked' ) ) ; } if ( $ user && $ user -> status == User :: STATUS_WAIT ) { throw new \ DomainException ( $ this -> i18n -> t ( 'setrun/user' , 'Account not confirmed' ) ) ; } $ this -> removeFailure ( ) ; return $ user ; }
User auth.
@param LoginForm $form
@return User
User auth .