title: Google signin callback - get name and email
body: <p>I am trying to trap basic google account information (name, email, id.) into a database on sign in.</p>
  
  <p>I am doing this by setting vars for their profile info and updating the database through AJAX.</p>
  
  <p>(see vars in example below)</p>
  
  <pre><code>if (authResult['access_token']) {
      // The user is signed in
      this.authResult = authResult;
      helper.connectServer();
      // After we load the Google+ API, render the profile data from Google+.
      //this renders profile information to the page just fine
      gapi.client.load('plus','v1',this.renderProfile);
  
          var email = gapi.client.load('plus','v1',this.getEmail);
          var acct_type = 'G';
          var id = gapi.client.load('plus','v1',this.getId);
          var fname = gapi.client.load('plus','v1',this.getFname);
          var lname = gapi.client.load('plus','v1',this.getLname);
  
      //DO AJAX!!
      $.post("_google/processlogindata.php", 
      {
          id:id,
          fname:fname,
          lname:lname,
          email:email,
          acct_type:acct_type
          });
  </code></pre>
  
  <p>The ajax is working, it passes the hardcode <code>'G'</code> and shows up in the db.</p>
  
  <p>The rest of the variables appear as blank entries, when the database default is NULL.</p>
  
  <p>I copied off of <code>renderProfile</code> since it worked for displaying profile bits on the page.  This is what getFname looks like, for example (they're all pretty much the same):</p>
  
  <pre><code>     getFname: function() {
    var request = gapi.client.plus.people.get( {'userId' : 'me'} );
    request.execute( function(profile) {
       return profile.name.GivenName;
    });},
  </code></pre>
  
  <p>If I set the return variable here to a static string like "name", it will show up in the database.  So the problem is definitely how I'm trying to access or save this profile information.</p>
  
  <p>So my question is, how do I trap these profile objects correctly to the vars above the AJAX?</p>