Utility function to return the current logged in user.
351229
function _loadUserFromToken(){
    return BB
        .bind(this)
        .then(function() {
            return grasshopper.request(this.token).users.current();
        })
        .then(function(user){
            this.user = user;
        });
}
1298225
def get_current_user(self, objectmask=None):
        """"""

        if objectmask is None:
            objectmask = "mask[userStatus[name], parent[id, username]]"
        return self.account_service.getCurrentUser(mask=objectmask)
65146
function() {
        var user = userStore.getUser();
        if (user) {
          $rootScope.user = user;
          authLogger.log('AuthService.withUser()', user);
          return $q.when(user);
        } else {
          authLogger.log('AuthService.withUser(), calling startLogin()');
          return this.startLogin();
        }
      }
538935
def get_user(self, user):
        
        return self.service.get_user(
            user, self.url_prefix, self.auth, self.session, self.session_send_opts)
1096791
public function getCurrentUser() {
    if (empty($this->currentUser)) {
      $this->currentUser = \Drupal::service('current_user');
    }
    return $this->currentUser;
  }
144036
public function getCurrentUser()
    {
        if ($this->currentuser === null) {
            $hash = $this->getCurrentSessionHash();
            if ($hash === false) {
                return false;
            }

            $uid = $this->getSessionUID($hash);
            if ($uid === false) {
                return false;
            }

            $this->currentuser = $this->getUser($uid);
        }
        return $this->currentuser;
    }
856405
def get_current_user(self, **params):
        """"""
        response = self._get('v2', 'user', params=params)
        return self._make_api_object(response, CurrentUser)
867649
public function user()
	{
		if ($this->loggedOut) return;

		// If we have already retrieved the user for the current request we can just
		// return it back immediately. We do not want to pull the user data every
		// request into the method because that would tremendously slow an app.
		if ( ! is_null($this->user))
		{
			return $this->user;
		}

		$id = $this->session->get($this->getName());

		// First we will try to load the user using the identifier in the session if
		// one exists. Otherwise we will check for a "remember me" cookie in this
		// request, and if one exists, attempt to retrieve the user using that.
		$user = null;

		if ( ! is_null($id))
		{
			$user = $this->provider->retrieveById($id);
		}

		// If the user is null, but we decrypt a "recaller" cookie we can attempt to
		// pull the user data on that cookie which serves as a remember cookie on
		// the application. Once we have a user we can return it to the caller.
		$recaller = $this->getRecaller();

		if (is_null($user) && ! is_null($recaller))
		{
			$user = $this->getUserByRecaller($recaller);

			if ($user)
			{
				$this->updateSession($user->getAuthIdentifier());

				$this->fireLoginEvent($user, true);
			}
		}

		return $this->user = $user;
	}
801891
public function user()
    {
        if ($this->loggedOut) {
            return;
        }

        // 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;
        }

        $id = $this->session->get($this->getName());

        // First we will try to load the user using the identifier in the session if
        // one exists. Otherwise we will check for a "remember me" cookie in this
        // request, and if one exists, attempt to retrieve the user using that.
        if (! is_null($id) && $this->user = $this->provider->retrieveById($id)) {
            $this->fireAuthenticatedEvent($this->user);
        }

        // If the user is null, but we decrypt a "recaller" cookie we can attempt to
        // pull the user data on that cookie which serves as a remember cookie on
        // the application. Once we have a user we can return it to the caller.
        if (is_null($this->user) && ! is_null($recaller = $this->recaller())) {
            $this->user = $this->userFromRecaller($recaller);

            if ($this->user) {
                $this->updateSession($this->user->getAuthIdentifier());

                $this->fireLoginEvent($this->user, true);
            }
        }

        return $this->user;
    }
699418
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 ($this->jwt->isHealthy()) {
            $id = $this->jwt->getId();
            $user = $this->provider->retrieveById($id);
        }

        return $this->user = $user;
    }
857392
def is_logged(self, user):
        """"""

        response = None
        if user.is_authenticated():
            if not user.needs_update:
                response = redirect('user_profile', username=user.username)

        return response
267854
def _current_user_manager(self, session=None):
        """"""
        if session is None:
            session = db.session()

        try:
            user = g.user
        except Exception:
            return session.query(User).get(0)

        if sa.orm.object_session(user) is not session:
            # this can happen when called from a celery task during development
            # (with CELERY_ALWAYS_EAGER=True): the task SA session is not
            # app.db.session, and we should not attach this object to
            # the other session, because it can make weird, hard-to-debug
            # errors related to session.identity_map.
            return session.query(User).get(user.id)
        else:
            return user
107364
public static function GetCurrentUser($guid = "CURRENT_USER")
	{
		if (self::$user == null)
		{
			self::Init();
			
			if (isset($_SESSION[$guid]))
			{
				self::$user = unserialize($_SESSION[$guid]);
			}		
		}
		return self::$user;
	}
98371
def get_me(self):
        
        response = self.request_json(self.config['me'])
        user = objects.Redditor(self, response['name'], response)
        user.__class__ = objects.LoggedInRedditor
        return user
1077276
def get_current_user(custom_headers:nil)
      response = get_current_user_async(custom_headers:custom_headers).value!
      response.body unless response.nil?
    end
1068098
def logged_in_user
      if (!logged_in?)
        return User.logged_out_user(@site.id) if @site
      end
      #return nil if !logged_in?
      return Caboose::User.where(:id => session["app_user"].id).first
    end
1028012
def get_user(self, request):
        
        try:
            return User.objects.get(username=request.data.get('username'),
                                    is_active=True)
        except User.DoesNotExist:
            return None