Get the currently authenticated user.

@return \Nova\Auth\UserInterface|null
769606
public function user()
    {
        // If we've already retrieved the user for the current request we can just
        // return it back immediately. We do not want to fetch the user data on
        // every call to this method because that would be tremendously slow.
        if (! is_null($this->user)) {
            return $this->user;
        }

        return $this->user = call_user_func($this->callback, $this->request);
    }
830555
public function getUser()
    {
        if (null === $this->getTokenStorage()->getToken()) {
            return null;
        }

        return $this->getTokenStorage()->getToken()->getUser();
    }
718105
public function getUser()
    {
        /** @var TokenInterface $token */
        $token = $this->application['security.token_storage']->getToken();
        if (null === $token) {
            return null;
        }

        $user = $token->getUser();
        if (!is_object($user)) {
            return null;
        }

        return $user;
    }
188369
protected function getUser()
    {
        if ($this->_user === null) {
            $this->_user = Admin::findByEmailOrMobileOrUsername($this->login);
        }
        return $this->_user;
    }
839583
public function getUser()
    {
        if ($this->_user === false) {
            $identity = Cii::$app->user->getIdentityGroupClass($this->group);
            $this->_user = $identity::findByUsername($this->username);
        }
        return $this->_user;
    }
551156
public function user()
    {
        if ($this->user !== null) {
            return $this->user;
        }

        if ($this->jwt->setRequest($this->request)->getToken() &&
            ($payload = $this->jwt->check(true)) &&
            $this->validateSubject()
        ) {
            return $this->user = $this->provider->retrieveById($payload['sub']);
        }
    }
1133587
public function getUser()
    {
        if (empty($this->obHelper)) {
            return null;
        }

        $sAuthFacadeClass = $this->obHelper->getAuthFacade();

        return $sAuthFacadeClass::getUser();
    }
1012681
public function user()
    {
        if (!is_null($this->user)) {
            return $this->user;
        }

        if ($this->jwt->setRequest($this->request)->getToken() && $this->jwt->check()) {
            $id = $this->jwt->payload()->get('sub');

            return $this->user = $this->provider->retrieveById($id);
        }
    }
802230
protected function getUser()
    {
        if ($this->_user === null) {
            $this->_user = DpAdminUser::findByUsername($this->username);
        }

        return $this->_user;
    }
433162
public function user()
	{
		if ($this->loggedOut)
		{
			return null;
		}

		if (!is_null($this->user))
		{
			return $this->user;
		}

		return $this->user = wp_get_current_user();
	}
294802
public function authenticate()
    {
        $response = $this->client->write(
            sprintf('/auth/userpass/login/%s', $this->username),
            ['password' => $this->password]
        );

        return $response->getAuth();
    }
1083280
public function getUser()
    {
        if ($this->_oActiveUser == null) {
            $this->_oActiveUser = false;
            $sOxId = $this->getEditObjectId();
            if (isset($sOxId) && $sOxId != "-1") {
                // load object
                $this->_oActiveUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
                $this->_oActiveUser->load($sOxId);
            }
        }

        return $this->_oActiveUser;
    }
1308449
public function getUser()
    {
        if ($this->userAuthenticated) {
            return $this->user;
        }

        try {
            // get token
            $this->user = new AnonymousUser();
            $tokenData = $this->getToken()->getUserFromToken();

            if (!$tokenData) {
                $this->eventManager()->fire(SecurityEvent::NOT_AUTHENTICATED, new SecurityEvent($this->user));

                $this->userAuthenticated = false;

                return $this->user;
            } else {
                $this->user->populate($tokenData->getUsername(), '', $tokenData->getRoles(), true);
                $this->user->setAuthProviderName($tokenData->getAuthProviderName());
                $this->user->setUserProviderName($tokenData->getUserProviderName());
                $this->eventManager()->fire(SecurityEvent::AUTHENTICATED, new SecurityEvent($this->user));
                $this->setUserRoles();

                $this->userAuthenticated = true;

                return $this->user;
            }
        } catch (TokenException $e) {
            throw $e;
        } catch (\Exception $e) {
            $this->userAuthenticated = true;
            throw new FirewallException($e->getMessage());
        }
    }
1252462
public function getUser()
    {
        if ($user = $this->provider->user()) {
            return ($field = $this->field) ? (string) $user->{$field} : $user->getAuthIdentifier();
        }
    }
1284545
public function user()
    {
        // If we've already retrieved the user for the current request we can just
        // return it back immediately. We do not want to fetch the user data on
        // every call to this method because that would be tremendously slow.
        if (! is_null($this->user)) {
            return $this->user;
        }

        $user = null;

        // If a user ID was provided in the JWT, then
        // we should attempt to fetch their profile.
        if (! empty($this->id())) {
            $user = $this->provider->retrieveById($this->id());
        }

        return $this->user = $user;
    }
692728
public static function getUser($username = null)
	{
		if ( is_null( $username ) ) $username = self::getCurrentUsername();

		if ( self::userExists( $username ) ) {
			return self::$auth['users'][ $username ];
		}

		return null;
	}
376481
protected function getActiveUser()
    {
        if (!Config::has('culpa.users.active_user')) {
            return Auth::check() ? Auth::user() : null;
        }

        $fn = Config::get('culpa.users.active_user');
        if (!is_callable($fn)) {
            throw new \Exception('culpa.users.active_user should be a closure');
        }

        return $fn();
    }