mnoorenberghe / webtrees-facebook

Facebook integration for webtrees genealogy software
https://mnoorenberghe.github.io/webtrees-facebook/
GNU General Public License v2.0
13 stars 5 forks source link

Undefined property: stdClass::$email preventing account creation #13

Open marafa opened 10 years ago

marafa commented 10 years ago

hi when i have the settings "Allow visitors to request account registration" enabled i get this error: ERROR 8: Undefined property: stdClass::$email 0 Error occurred on line 492 of file module.php in function login_or_register 1 called from line 304 of file module.php in function connect 2 called from line 71 of file module.php in function modAction 3 called from line 33 of file module.php

Notice: Undefined property: stdClass::$email in /home/shagarat/public_html/modules_v3/facebook/module.php on line 492

ERROR 8: Undefined property: stdClass::$email 0 Error occurred on line 533 of file module.php in function login_or_register 1 called from line 304 of file module.php in function connect 2 called from line 71 of file module.php in function modAction 3 called from line 33 of file module.php

Notice: Undefined property: stdClass::$email in /home/shagarat/public_html/modules_v3/facebook/module.php on line 533

when it is disabled i get this error:

ERROR 8: Undefined property: stdClass::$email 0 Error occurred on line 492 of file module.php in function login_or_register 1 called from line 304 of file module.php in function connect 2 called from line 71 of file module.php in function modAction 3 called from line 33 of file module.php

Notice: Undefined property: stdClass::$email in /home/shagarat/public_html/modules_v3/facebook/module.php on line 492

in both cases, my users are unable to login

pls advise

marafa commented 10 years ago

i found this in the logs underneath the error i posted above: Facebook: Couldn't create the user account

marafa commented 10 years ago

just noticed the login page has this line below the php errors

Unable to create your account. Please try again.

mnoorenberghe commented 10 years ago

Did you grant the Facebook application access to your email address the first time you used it? You can check in your App Settings on Facebook. I just added a nicer error message if this happens in 5ce1638c73

mnoorenberghe commented 10 years ago

It would be nice to let the user re-auth and add the email permission as described at https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v2.0#re-asking-declined-permissions but I haven't seen how to do this without an SDK yet.

marafa commented 10 years ago

hello yes, i have 4 users who are authenticated via facebook and the rest get that error