nl_tokens: ### _doAuth
pl_tokens: function _doAuth ( auth ) { if ( oauth ) return vow . resolve ( ) dbg ( 'doing oAuth2' ) const googleAuth = <mask> GoogleAuth ( ) oauth = new googleAuth . OAuth2 ( auth . client_id , auth . client_secret , [ 'urn:ietf:wg:oauth:2.0:oob' , 'http://localhost' ] ) return vow . resolve ( ) . then ( ( ) => { // see if token has been recorded in config let configToken = config . get ( 'metalsmith-google-drive' ) . token // no idea why google auth needs the token to be writable, but whatever if ( configToken ) configToken = config . util . cloneDeep ( configToken ) // fall back to cache (params), then do token flow return configToken || valueCache . retrieve ( 'token' ) || _tokenFlow ( ) } ) . then ( ( token ) => { oauth . credentials = token } ) . catch ( ( err ) => { // if some failure occurred invalidate oauth object so we don't simply // try to use it next time. oauth = false return vow . reject ( err ) } ) }