I have a site that uses FB Login/Signup button. This button is handled by JavaScript SDK. Also in the sign up page, I have another type of signup form. So basically, I have two ways on how to sign up on my site.
Here is my Facebook Signup Code:
FB.init({
appId:'xxxxxxxxx',
cookie:true,
status:true,
xfbml:true
});
FB.Event.subscribe('auth.login', function() { processLogin() } );
function processLogin(){
if(FB.getSession() != null){
FB.api('/me', function(user) {
if(user != null) {
#Ajax code here for inserting data to the database#
}
});
}
}
Now my problem is, whenever I’m currently logged in to my facebook account, and opt to do the conventional sign up form, the javascript function called ‘processLogin’ will be triggered without clicking the FB sign up button. I am still new to FB SDK, but I believe the FB.Event.subscribe('auth.login', function() {processLogin()}); is causing the problem. How will I fix this problem? Any suggestion would be greatly appreciated.
Thanks!
I believe you want
auth.changeoverauth.login. Let me know if that doesn’t solve your issue.