public function login($duration = 0)
    {
        if ($this->beforeLogin()) {
            $result = $this->webUser->login($this->getIdentity(), $this->rememberMe ? $duration : 0);
            if ($result) {
                $this->afterLogin();
            }

            return $result;
        }

        return false;
    }