Google+ Signin callback function not found if inside a module

google-plus

Solution

The signin callback must be a global function for the widget to find it. Wrap your callback as such:

function onSigninCallback(e){
    Auth.gPlusSignCallback(e);
}

Problem

I'm having some strange issue when I place the callback function inside a module, the library cannot seem to find the function, so if I use: ``` var Auth = (function () { var gPlusSignCallback = function () { console.log("Google plus signin call back done!"); }; return { gPlusSignCallback: gPlusSignCallback }; }()); ``` And in the html snipped of the Google+ Signing button I use: ``` data-callback="Auth.gPlusSignCallback" ``` I get the following error: Callback function named "Auth.gPlusSignCallback" not found If I put the gPlusSignCallback outside the module everything works well. I checked the documentation and it says that the value must be a function in the global namespace. So is it not working by design? I need to make global variable that makes reference to the function in the module?

Original source