lib/oauth/common.js
function (req, res) {
    var oauthQueryStateToken = req.query.state;
    var oauthCookieStateToken = req.cookies.oauthStateToken;

    if (!oauthQueryStateToken || (!oauthCookieStateToken)) {
      return false;
    } else if (oauthQueryStateToken !== oauthCookieStateToken) {
      return false;
    }

    res.clearCookie('oauthStateToken');

    return true;
  }
function (req, res) {
    var oauthQueryStateToken = req.query.state;
    var oauthCookieStateToken = req.cookies.oauthStateToken;

    if (!oauthQueryStateToken || (!oauthCookieStateToken)) {
      return false;
    } else if (oauthQueryStateToken !== oauthCookieStateToken) {
      return false;
    }

    res.clearCookie('oauthStateToken');

    return true;
  }
function ( req , res ) { var oauthQueryStateToken = req . query . state ; var oauthCookieStateToken = req . cookies . oauthStateToken ; if ( ! oauthQueryStateToken || ( ! oauthCookieStateToken ) ) { return false ; } else if ( oauthQueryStateToken !== oauthCookieStateToken ) { return false ; } res . clearCookie ( 'oauthStateToken' ) ; return true ; }
Consume a state token cookie.

@method
@private

@param {Object} req - The http request.
@param {Object} res - The http response.
@return {bool} Whether or not the token was successfully verified and consumed.
Consume a state token cookie .