auth.js
function(code, cb) {
        var self = this;
        this.oauthClient.getToken(code, function(err, token) {
            if (err) {
                cb({
                    err: err,
                    msg: 'Error while trying to retrieve access token'
                });
                return;
            }
            self.storeToken(token);
            cb(null, {
                resp: token,
                msg: "Google auth code successfully set"
            });
        });
    }
function(code, cb) {
        var self = this;
        this.oauthClient.getToken(code, function(err, token) {
            if (err) {
                cb({
                    err: err,
                    msg: 'Error while trying to retrieve access token'
                });
                return;
            }
            self.storeToken(token);
            cb(null, {
                resp: token,
                msg: "Google auth code successfully set"
            });
        });
    }
function ( code , cb ) { var self = this ; this . oauthClient . getToken ( code , function ( err , token ) { if ( err ) { cb ( { err : err , msg : 'Error while trying to retrieve access token' } ) ; return ; } self . storeToken ( token ) ; cb ( null , { resp : token , msg : "Google auth code successfully set" } ) ; } ) ; }
Used to set the code provided by the generated auth url.
This code is generated for a user and is needed to initiate the oauth2 handshake

@param  code  the code obtained by a user from the auth url
Used to set the code provided by the generated auth url . This code is generated for a user and is needed to initiate the oauth2 handshake