server/routes/sc-connect-api.js
// Grabs the google info for the user of the given id token and passes it back in google's user model format (their dict keys).
Grabs the google info for the user of the given id token and passes it back in google's user model format (their dict keys).
Grabs the google info for the user of the given id token and passes it back in google ' s user model format ( their dict keys ) .
function fetchUserForIDTokenFromGoogleAPI(idToken, callback) {
    if (idToken) {
        var serverClient = new googleAuth.OAuth2(serverGoogleClientID, '', ''); 
        serverClient.verifyIdToken(idToken, iosGoogleClientID, function (error, login) { 
            if (error) {
                console.log(error);
                callback(null);
            } else {
                var googleUser = login.getPayload();
                callback(googleUser);
            }
        });
    } else {
        callback(null);
    }
}
function fetchUserForIDTokenFromGoogleAPI ( idToken , callback ) { if ( idToken ) { var serverClient = new googleAuth . OAuth2 ( serverGoogleClientID , '' , '' ) ; serverClient . verifyIdToken ( idToken , iosGoogleClientID , function ( error , login ) { if ( error ) { console . log ( error ) ; callback ( null ) ; } else { var googleUser = login . getPayload ( ) ; callback ( googleUser ) ; } } ) ; } else { callback ( null ) ; } }
Grabs the google info for the user of the given id token and passes it back in google's user model format (their dict keys).
Grabs the google info for the user of the given id token and passes it back in google ' s user model format ( their dict keys ) .
//uses server client id w/o a secret because with an id token, the user information is publicly accessible //uses ios client id bc id token generated for that client