lib/user.js
function() {
      if (Parse.User._currentUser) {
        return Parse.User._currentUser;
      }

      if (Parse.User._currentUserMatchesDisk) {
        
        return Parse.User._currentUser;
      }

      // Load the user from local storage.
      Parse.User._currentUserMatchesDisk = true;

      var userData = Parse.localStorage.getItem(Parse._getParsePath(
          Parse.User._CURRENT_USER_KEY));
      if (!userData) {
        
        return null;
      }
      Parse.User._currentUser = Parse.Object._create("_User");
      Parse.User._currentUser._isCurrentUser = true;

      var json = JSON.parse(userData);
      Parse.User._currentUser.id = json._id;
      delete json._id;
      Parse.User._currentUser._sessionToken = json._sessionToken;
      delete json._sessionToken;
      Parse.User._currentUser._finishFetch(json);

      Parse.User._currentUser._synchronizeAllAuthData();
      Parse.User._currentUser._refreshCache();
      Parse.User._currentUser._opSetQueue = [{}];
      return Parse.User._currentUser;
    }
function() {
      if (Parse.User._currentUser) {
        return Parse.User._currentUser;
      }

      if (Parse.User._currentUserMatchesDisk) {
        
        return Parse.User._currentUser;
      }

      // Load the user from local storage.
      Parse.User._currentUserMatchesDisk = true;

      var userData = Parse.localStorage.getItem(Parse._getParsePath(
          Parse.User._CURRENT_USER_KEY));
      if (!userData) {
        
        return null;
      }
      Parse.User._currentUser = Parse.Object._create("_User");
      Parse.User._currentUser._isCurrentUser = true;

      var json = JSON.parse(userData);
      Parse.User._currentUser.id = json._id;
      delete json._id;
      Parse.User._currentUser._sessionToken = json._sessionToken;
      delete json._sessionToken;
      Parse.User._currentUser._finishFetch(json);

      Parse.User._currentUser._synchronizeAllAuthData();
      Parse.User._currentUser._refreshCache();
      Parse.User._currentUser._opSetQueue = [{}];
      return Parse.User._currentUser;
    }
function ( ) { if ( Parse . User . _currentUser ) { return Parse . User . _currentUser ; } if ( Parse . User . _currentUserMatchesDisk ) { return Parse . User . _currentUser ; } // Load the user from local storage. Parse . User . _currentUserMatchesDisk = true ; var userData = Parse . localStorage . getItem ( Parse . _getParsePath ( Parse . User . _CURRENT_USER_KEY ) ) ; if ( ! userData ) { return null ; } Parse . User . _currentUser = Parse . Object . _create ( "_User" ) ; Parse . User . _currentUser . _isCurrentUser = true ; var json = JSON . parse ( userData ) ; Parse . User . _currentUser . id = json . _id ; delete json . _id ; Parse . User . _currentUser . _sessionToken = json . _sessionToken ; delete json . _sessionToken ; Parse . User . _currentUser . _finishFetch ( json ) ; Parse . User . _currentUser . _synchronizeAllAuthData ( ) ; Parse . User . _currentUser . _refreshCache ( ) ; Parse . User . _currentUser . _opSetQueue = [ { } ] ; return Parse . User . _currentUser ; }
Retrieves the currently logged in ParseUser with a valid session,
either from memory or localStorage, if necessary.
@return {Parse.Object} The currently logged in Parse.User.
Retrieves the currently logged in ParseUser with a valid session either from memory or localStorage if necessary .