I am trying to integrate Google Login into my web application.
There is a Google button on my page:
ModalDialogue.cshtml: <a class="google g-signin2" data-onsuccess="onSignIn">Sign up with Google+</a>
I am trying to call this method in js:
ModalDialogue.js: function onSignIn(googleUser) { var profile = googleUser.getBasicProfile(); console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead. console.log('Name: ' + profile.getName()); console.log('Image URL: ' + profile.getImageUrl()); console.log('Email: ' + profile.getEmail()); }
I know that
a] JavaScript is in the page area, since my other functions - opening and closing the dialog - DO work.
b] the button interacts with Google, as clicking on it opens the "login with Google" dialog, and then after that - after that the "Login" button changes.
How to call the onSignIn method? Or at least how to determine if onsuccess is starting?
source share