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

    if (!oauthStateToken) {
      oauthStateToken = uuid.v4();
      setTempCookie(res, 'oauthStateToken', oauthStateToken);
    }

    return oauthStateToken;
  }
function (req, res) {
    var oauthStateToken = req.cookies.oauthStateToken;

    if (!oauthStateToken) {
      oauthStateToken = uuid.v4();
      setTempCookie(res, 'oauthStateToken', oauthStateToken);
    }

    return oauthStateToken;
  }
function ( req , res ) { var oauthStateToken = req . cookies . oauthStateToken ; if ( ! oauthStateToken ) { oauthStateToken = uuid . v4 ( ) ; setTempCookie ( res , 'oauthStateToken' , oauthStateToken ) ; } return oauthStateToken ; }
Resolve a state token from a request.
If then token doesn't exist then a new token is created and appended onto the response.

@method
@private

@param {Object} req - The http request.
@param {Object} res - The http response.
@return {string} A state token (UUID).
Resolve a state token from a request . If then token doesn t exist then a new token is created and appended onto the response .