auth/google-oauth.js
function signOutUser(req, res, next) {
    debug('Signing out user');
    //make a best attempt effort at revoking the tokens
    var accessToken = req.session.auth ? req.session.auth.access_token: null;
    var refreshToken = req.session.auth ? req.session.auth.refresh_token: null;
    if (accessToken) {
        debug('Revoking access token');
        request.get({
            url: LOGOUT_URL,
            qs: {
                token: accessToken
            }
        }, function(err, response, body) {
            if (err) {
                debug('Error revoking access token', err.message);
            } else {
                debug('Revoked access token, %s', response.statusCode);
            }
        });
    }

    if (refreshToken) {

        request.get({
            url: LOGOUT_URL,
            qs: {
                token: refreshToken
            }
        }, function (err, response, body) {
            if (err) {
                debug('Error revoking refresh token', err.message);
            } else {
                debug('Revoked refresh token, %s', response.statusCode);
            }
        });
    }
    delete req.session.auth;
    res.sendStatus(200);
}
function signOutUser(req, res, next) {
    debug('Signing out user');
    //make a best attempt effort at revoking the tokens
    var accessToken = req.session.auth ? req.session.auth.access_token: null;
    var refreshToken = req.session.auth ? req.session.auth.refresh_token: null;
    if (accessToken) {
        debug('Revoking access token');
        request.get({
            url: LOGOUT_URL,
            qs: {
                token: accessToken
            }
        }, function(err, response, body) {
            if (err) {
                debug('Error revoking access token', err.message);
            } else {
                debug('Revoked access token, %s', response.statusCode);
            }
        });
    }

    if (refreshToken) {

        request.get({
            url: LOGOUT_URL,
            qs: {
                token: refreshToken
            }
        }, function (err, response, body) {
            if (err) {
                debug('Error revoking refresh token', err.message);
            } else {
                debug('Revoked refresh token, %s', response.statusCode);
            }
        });
    }
    delete req.session.auth;
    res.sendStatus(200);
}
function signOutUser ( req , res , next ) { debug ( 'Signing out user' ) ; //make a best attempt effort at revoking the tokens var accessToken = req . session . auth ? req . session . auth . access_token : null ; var refreshToken = req . session . auth ? req . session . auth . refresh_token : null ; if ( accessToken ) { debug ( 'Revoking access token' ) ; request . get ( { url : LOGOUT_URL , qs : { token : accessToken } } , function ( err , response , body ) { if ( err ) { debug ( 'Error revoking access token' , err . message ) ; } else { debug ( 'Revoked access token, %s' , response . statusCode ) ; } } ) ; } if ( refreshToken ) { request . get ( { url : LOGOUT_URL , qs : { token : refreshToken } } , function ( err , response , body ) { if ( err ) { debug ( 'Error revoking refresh token' , err . message ) ; } else { debug ( 'Revoked refresh token, %s' , response . statusCode ) ; } } ) ; } delete req . session . auth ; res . sendStatus ( 200 ) ; }
Revoke the access token, refresh token, and cookies
Revoke the access token refresh token and cookies