Gets the current authentication status.
The `force` property will trigger an API request to update session data.

@method getStatus
@param {Object} options
@param {function} [callback]
508033
function getStatus(options, callback) {
  if (typeof options === 'function') {
      callback = options;
  }
  if (typeof callback !== 'function') {
      callback = function() {};
  }
  if (!core.session) {
    throw new Error('You must call init() before getStatus()');
  }

  if (options && options.force) {
    updateSession(function(err, session) {
      callback(err, makeSession(session || core.session));
    });
  } else {
    callback(null, makeSession(core.session));
  }
}
377253
function login(options) {

    // Return promise and resolve once user info is retrieved.
    return new Promise(function (resolve, reject) {

      FB.login(function (response) {

        /*response = authResponse + status*/
        _getUser(response).then(function (userResponse) {

          if(userResponse.user) {

            /*userResponse = authResponse + status + user*/
            resolve(userResponse);

          } else {

            // Reject login promise if the user canceled the FB login.
            reject(userResponse);

          }

        });

      }, options);

    });
  }
1101990
function statusValid (xhr) {
	try {
		var status = xhr.status
		return (status !== null && status !== 0)
	} catch (e) {
		return false
	}
}
114952
function(callback) {
        var self = this;

        var requestOptions = {
            uri: '/status/' + self.id,
            qs: { showDetails: true },
            endpoint: rackspace.Endpoints.CloudDns
        };

        self.client.authorizedRequest(requestOptions, function(err, res, body) {
            if (err) {
                callback(err);
                return;
            }

            self._setProperties(body);
            callback(err, self);
        });
    }
605973
function(callback) {
        if (res.parsedHeader.payload.mode === 'handshake') {
          res.session = {
            sid: reqSid,
            cert: senderCert,
            token: reqToken
          };
          callback(null);
        } else {
          var querySid;
          if (sessionStore instanceof Store || 'undefined' !== typeof window) {
            querySid = my.config.urlBase;
          } else {
            querySid = reqSid;
          }
          // load the session if exists
          sessionStore.load(querySid, function(err, session){
            if (err) {
              callback(err);
            } else if (session) {
              log.debug('%s loaded session', app.name);
              log.debug(session);
              res.session = session;
              callback(null);
            } else {
              callback('session expired');
            }
          });
        }
      }
1040612
function checkIfAnotherSessionInProgress() {
        var result = $.Deferred();
        if(updateJsonHandler) {
            var state = updateJsonHandler.state;

            updateJsonHandler.refresh()
                .done(function() {
                    var val = updateJsonHandler.get(updateProgressKey);
                    if(val !== null) {
                        result.resolve(val);
                    } else {
                        result.reject();
                    }
                })
                .fail(function() {
                    updateJsonHandler.state = state;
                    result.reject();
                });
        }
        return result.promise();
    }
1264938
function(cb, force) {
        if (!VK._apiId) {
          return;
        }

        if (cb) {
          if (!force && VK.Auth._loadState == 'loaded') {
            cb({status: VK._userStatus, session: VK._session});
            return;
          } else {
            VK.Observer.subscribe('auth.loginStatus', cb);
          }
        }

        if (!force && VK.Auth._loadState == 'loading') {
          return;
        }

        VK.Auth._loadState = 'loading';

        var url = 'https://login.vk.com/?act=openapi&oauth=1&aid=' + parseInt(VK._apiId, 10) + '&location=' + encodeURIComponent(window.location.hostname);
        if (VK.Api.supportCORS()) {
          var loginCallback = function(response) {
            if (!this.JSON) {
              this.JSON = {};
            }

            if (typeof JSON.parse !== 'function') {
              //IE6 and IE7
              response = eval(response);
            } else {
              response = JSON.parse(response);
            }

            VK.Auth._loadState = 'loaded';
            if (response && response.auth) {
              var session = {
                mid: response.user.id,
                sid: response.access_token,
                sig: response.sig,
                secret: response.secret,
                expire: response.expire
              };

              if (force) {
                session.user = response.user;
              }

              var status = 'connected';
            } else {
              var session = null;
              var status = response.user ? 'not_authorized' : 'unknown';
              VK.Cookie.clear();
            }

            VK.Auth.setSession(session, status, false, response);
            VK.Observer.publish('auth.loginStatus', {session: session, status: status});
            VK.Observer.unsubscribe('auth.loginStatus');
          };

          VK.Api.makeRequest(url + '&new=1', loginCallback);
        } else {
          var rnd = parseInt(Math.random() * 10000000, 10);
          while (VK.Auth.lsCb[rnd]) {
            rnd = parseInt(Math.random() * 10000000, 10);
          }

          VK.Auth.lsCb[rnd] = function(response) {
            delete VK.Auth.lsCb[rnd];
            VK.Auth._loadState = 'loaded';
            if (response && response.auth) {
              var session = {
                mid: response.user.id,
                sid: response.access_token,
                sig: response.sig,
                secret: response.secret,
                expire: response.expire
              };
              if (force) session.user = response.user;
              var status = 'connected';
            } else {
              var session = null;
              var status = response.user ? 'not_authorized' : 'unknown';
              VK.Cookie.clear();
            }
            VK.Auth.setSession(session, status, false, response);
            VK.Observer.publish('auth.loginStatus', {session: session, status: status});
            VK.Observer.unsubscribe('auth.loginStatus');
          };

            // AttachScript here
          VK.Api.attachScript(url+'&rnd='+rnd);
        }
      }
553304
function status(url, code, mod) {
      return this.get(url, mod).then(req => req.statusCode === code);
    }
521354
function Session(options) {
  options = options || {};
  this.id = options.id || this._guid();
  this.parent = options.parent || undefined;
  this.authenticating = options.authenticating || false;
  this.authenticated = options.authenticated || undefined;
  this.user = options.user || 'guest';
  this.host = options.host;
  this.address = options.address || undefined;
  this._isLocal = options.local || undefined;
  this._delimiter = options.delimiter || String(os.hostname()).split('.')[0] + '~$';
  this._modeDelimiter = undefined;

  // Keeps history of how many times in a row `tab` was
  // pressed on the keyboard.
  this._tabCtr = 0;

  this.cmdHistory = this.parent.cmdHistory;

  // Special command mode vorpal is in at the moment,
  // such as REPL. See mode documentation.
  this._mode = undefined;

  return this;
}
569277
function handleStatusChange(response) {
  if (response.authResponse) {
    logResponse(response);
    window.location.hash = '#menu';
    updateUserInfo(response);
  } else {
    window.location.hash = '#login';
  }
}
1056065
function getStatus (res) {
		let status;
		const statusCode = res.statusCode;
		if (statusCode) {
			status = Math.floor(statusCode / 100) * 100;
		}
		switch (status) {
			case 100:
			case 200:
			case 300:
				return 'success';
			default:
				return 'failure';
		}
	}
983227
function TokenRequest(authenticate, options) {

	var self = this;
	this.status = 'expired';
	this.pendingCallbacks = [];

	// execute accumulated callbacks during the 'pending' state
	function fireCallbacks(err, token) {
		self.pendingCallbacks.forEach(function (callback) {
			callback(err, token);
		});
		self.pendingCallbacks = [];
	}

	TokenRequest.prototype.get = function (callback) {

		if (this.status == 'expired') {

			this.status = 'pending';
			this.pendingCallbacks.push(callback);

			authenticate(options, function (err, token) {
				if (err) {
					self.status = 'expired';
					return fireCallbacks(err, null);
				}
				self.issued = Date.now();
				self.duration = options.expiration || 60 * 60 * 1000;
				self.token = token;
				self.status = 'completed';
				return fireCallbacks(null, token);
			});

		} else if (this.status == 'pending') {
			// wait for the pending request instead of issuing a new one
			this.pendingCallbacks.push(callback);
		} else if (this.status == 'completed') {

			if (this.issued + this.duration < Date.now()) {
				this.status = 'expired';
				debug('token is expired, a new token will be requested');
				this.get(callback);
			} else {
				callback(null, this.token);
			}

		}
	};
}
385303
function( options ){
			if(this.name == getCurrent().name){
				return options.fn(this)
			} else {
				return helpers.ifHasActive.apply(this, arguments);
			}
		}
175250
def user_logged_in=(logged_in_option)
      raise JSS::InvalidDataError, "user_logged_in options: #{USER_LOGGED_IN.join(', ')}" unless USER_LOGGED_IN.include? logged_in_option
      @reboot_options[:user_logged_in] = logged_in_option
      @need_to_update = true
    end
1327675
function processGetStats(req,res){

    processAuth(req,res).then(function (authResult){
        if(!authResult){
            return;
        }
        res.status(200);
        if(('sws-auth' in req) && req['sws-auth']){
            res.setHeader('x-sws-authenticated','true');
        }
        res.json( processor.getStats( req.query ) );
    });

    /*
    if(!processAuth(req,res)) {
        return;
    }

    if(('sws-auth' in req) && req['sws-auth']){
        res.setHeader('x-sws-authenticated','true');
    }

    res.status(200).json( processor.getStats( req.query ) );
    */
}
342818
function  (options, status) {
  this.name = ''
  this.error = options.error
  this.error_description = options.error_description
  this.message = options.error_description
  // this.realm             = options.realm
  // this.scope             = options.scope
  this.statusCode = options.statusCode || 401
}
1079199
function verify(token, sign, options) {
  return function (done) {
    _jsonwebtoken2['default'].verifySync(token, sign, options, done);
  };
}