sirkitree / angular-directive.g-signin

:triangular_ruler: AngularJS Directive for Google Plus Sign-in Button
http://jeradbitner.com/angular-directive.g-signin/
148 stars 84 forks source link

User Identification #27

Closed saurabh-p closed 9 years ago

saurabh-p commented 10 years ago

How to get the email-id, username etc for the user. Since the auth token presently doesn't have any field to "identify" the user.

thoughtpalette commented 10 years ago

+1

nicktombeur commented 9 years ago

I wondered the same thing. Got it done like this.

    $scope.$on('event:google-plus-signin-success', function(event, authResult) {
        gapi.client.load('plus', 'v1', apiClientLoaded)
    });

    function apiClientLoaded() {
        gapi.client.plus.people.get({userId: 'me'}).execute(handleResponse);
    }

    function handleResponse(resp) {
        console.log(resp);
    }