• Rakesh Roy

    (@rakeshcob)


    i need to add some more field like age to the user when they register with google ,
    m able to do the process with facebook but the js in google.js is different from facebook.js

    Please help

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Heateor Support

    (@heateor)

    Google returns the age of the user in profile data. You can try logging the profile data from google.js file and use that at your website.

    Thread Starter Rakesh Roy

    (@rakeshcob)

    function theChampGoogleOnLoad() {
        theChampDisplayLoginIcon(document, ["theChampGoogleButton", "theChampGoogleLogin"])
    }
    
    function theChampInitializeGPLogin() {
        gapi.auth.signIn({
            callback: theChampGPSignInCallback,
            clientid: theChampGoogleKey,
            cookiepolicy: "single_host_origin",
            scope: "profile email"
        })
    }
    
    function theChampGPSignInCallback(a) {
        a.status.signed_in && "PROMPT" == a.status.method ? gapi.client.load("plus", "v1", function() {
            a.access_token ? theChampGetProfile() : ""
        }) : ""
    }
    
    function theChampGetProfile() {
        theChampLoadingIcon();
        var a = gapi.client.plus.people.get({
            userId: "me"
        });
        a.execute(function(a) {
            return a.error ? void("Access Not Configured. Please use Google Developers Console to activate the API for your project." == a.message && (alert(theChampGoogleErrorMessage), window.open("https://support.heateor.com/how-to-get-google-plus-client-id/"))) : void(a.id && theChampCallAjax(function() {
                theChampAjaxUserAuth(a, "google")
            }))
        })
    }! function() {
        var a = document.createElement("script");
        a.type = "text/javascript", a.async = !0, a.src = "https://apis.google.com/js/client:platform.js?onload=theChampGoogleOnLoad";
        var b = document.getElementsByTagName("script")[0];
        b.parentNode.insertBefore(a, b)
    }();

    can you tell me which object returns all the fields , which one to log

    Plugin Author Heateor Support

    (@heateor)

    Object a passed in theChampAjaxUserAuth(a, "google") function is the complete profile data Google returns. You should log this to retrieve age.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Google Social Login – Extra Field like Age’ is closed to new replies.