Login with User istance.

@param \Assely\Adapter\User $user
@param bool $remember
@param string $secure

@return void
513078
public function login(
        User $user,
        $remember = false,
        $secure = ''
    ) {
        wp_set_auth_cookie($user->id, $remember, $secure);

        wp_set_current_user($user->id);
    }
966605
public static function login( Account $acct, $remember = false )
	{
		static::__do( __FUNCTION__, args_with_keys( func_get_args(), __CLASS__, __FUNCTION__ ) );
	}
46532
public function attempt(array $credentials = array(), $remember = false, $login = true, $secure = false)
	{
		$this->fireAttemptEvent($credentials, $remember, $login);

		if (!$login)
		{
			return $this->validate($credentials);
		}

		try
		{
			$this->login($credentials, $remember, $secure);
		} catch (LoginFailedException $e)
		{
			$this->setError($e);

			return false;
		}

		return true;
	}
1299615
public function authenticate(array $credentials, $remember = false)
    {
        $user = $this->sentry->authenticate($credentials,$remember);
        $this->event->fire('users.login',array($user));
        return $user;
    }
81347
public function logUser(User $user)
    {
        // TODO : log in an EventListener on user log event instead
        $this->strictEventDispatcher->dispatch('log', 'Log\LogUserLogin', [$user]);

        // TODO : nope, we should let Symfony handles token creation
        $token = new UsernamePasswordToken($user, null, 'main', $user->getRoles());
        $this->tokenStorage->setToken($token);

        if (null === $user->getInitDate()) {
            $this->setUserInitDate($user);
        }
        $user->setLastLogin(new \DateTime());

        $this->objectManager->persist($user);
        $this->objectManager->flush();
    }
800046
public function login($login, $password, $remindme = true)
  {
    $this->user = $this->findUser($login, $password);

    return $this->user
      ? $this->saveToken($remindme)
      : false;
  }
875098
protected function login(Request $request, User $user)
    {
        impersonate()->login($user);

        // if redirect url in request
        if ($request->has('redirect_to')) {
            return redirect($request->get('redirect_to'));
        }

        return back();
    }
121439
public function updatePassword(User $user, $password) : User
    {
        $user->updatePassword($password);
        $this->repository->add($user);

        return $user;
    }
1161609
public function login($credentials = array(), $remember = false, $secure = false)
	{
		$creds = array();

		$creds[$this->getLoginField()] = $this->getLoginCredential($credentials);

		$creds[$this->getPasswordField()] = $this->getPasswordCredential($credentials);

		$creds['remember'] = $remember;

		$user = wp_signon($creds, $secure);

		/**
		 * throw exception encapsulation of WP_Error
		 */
		if (is_wp_error($user))
		{
			throw new LoginFailedException($user);
		}

		// If we have an event dispatcher instance set we will fire an event so that
		// any listeners will hook into the authentication events and run actions
		// based on the login and logout events fired from the guard instances.
		if (isset($this->events))
		{
			$this->events->fire('auth.login', array($user, $remember));
		}

		$this->setUser($user);

		return true;
	}
15161
public function login($user, $password, $tryApop = true)
    {
        if ($tryApop && $this->_timestamp) {
            try {
                $this->request("APOP $user ".md5($this->_timestamp.$password));
                return;
            } catch (\Exception $e) {
                // ignore
            }
        }

        $this->request("USER $user");
        $this->request("PASS $password");
    }
821179
public function login($user, $remember = false, $options = [])
    {
        if (!is_array($user) && !is_object($user)) {
            throw new \InvalidArgumentException('Credential should be array or object.');
        }

        if (!$user instanceof Credential) {
            $user = new Credential($user);
        }

        $options = $options instanceof Structure ? $options : new Structure($options);

        $options['remember'] = $remember;

        // Before login event
        $this->triggerEvent('onUserBeforeLogin', ['user' => &$user, 'options' => &$options]);

        // Do login
        try {
            if ($result = $this->authentication->authenticate($user)) {
                $user = $this->authentication->getCredential();

                // Authorise event
                $this->triggerEvent('onUserAuthorisation', [
                    'user' => &$user,
                    'authorisation' => $this->getAuthorisation(),
                    'options' => &$options,
                    'result' => &$result,
                ]);

                if ($result) {
                    $result = $this->makeUserLoggedIn($user);
                }
            }

            // After login event
            $this->triggerEvent('onUserAfterLogin', [
                'user' => $user,
                'options' => $options,
                'result' => &$result,
            ]);

            if (!$result) {
                throw new AuthenticateFailException($this->authentication->getResults());
            }
        } catch (AuthenticateFailException $e) {
            $this->triggerEvent('onUserLoginFailure', [
                'user' => $user,
                'options' => $options,
                'results' => $this->authentication->getResults(),
                'exception' => $e,
            ]);

            throw $e;
        }

        return true;
    }
631227
public function setIdentity(Identity $user, $remember = false)
    {
        $this->identity = $user;

        Application::$instance->getResponse()->addCookie(self::TOKEN_NAME,
            $user->getAuthToken(),
            $remember ? time() + 365 * 24 * 60 * 60 : null, '/');
        return $this;
    }
541110
private function isSecureExpired(User $user)
    {
        // never expired
        if (!$this->expirationPeriod) {
            return false;
        }

        if (!$lastLogin = $user->getLineLastLogin()) {
            return true;
        }

        return (new \DateTime('-'.$this->expirationPeriod)) > $lastLogin;
    }
1015129
public static function login($userLogin, $userPassword)
    {
        try {
            $user = self::authenticate($userLogin, $userPassword);
            $loggedIn = self::startSession($user);
        } catch (common_user_auth_AuthFailedException $e) {
            $loggedIn = false;
        }
        return $loggedIn;
    }
197601
public static function create(AbstractUser $user, bool $remember = false): UserAccessTokenInterface
    {
        $token = self::find()->where(['user_id' => $user->id, 'is_active' => 1])->orderBy(['created_at' => SORT_DESC])->one();
        if ($token instanceof UserAccessTokenInterface && $token->expired_at > time()) {
            return $token;
        }
        $user->deactivateTokens();
        $new_token = new static([
            'user_id' => $user->id,
            'access_token' => self::generateToken($user->email),
            'expired_at' => self::generateExpired($remember),
            'is_active' => 1,
        ]);
        (new UserAccessTokenHandler($new_token))->create();
        $new_token->refresh();
        $user->updateLastEntering();
        return $new_token;
    }
1314473
private function userAttemptBruteForceLockHasExceeded(User $user)
    {
        if ($user->login_attempt_lock_expiration > time()) {
            $user->updateAttributes(['login_attempt' => 0]);
            
            return true;
        }
        
        return false;
    }
1332400
public function login(User $user)
    {
        // if not impersonated, save current logged in user
        // otherwise do not update (leave first original user in session)
        if (!$this->isActive()) {
            session()->put($this->originalUserKey, auth()->user()->id);
        }

        auth()->loginUsingId($user->id);

        session()->put($this->isActiveKey, true);
    }