laravel - Making it mendatory to get email with facebook oAuth with Socialite -


i trying use facebook oauth users login/register website. this, require user's email address

facebook oauth dialog has option provide / not provide email if user's doesn't provide email, cannot re-request authorization facebook again considers user logged in , redirects call url.

i using laravel , socialite package.

any solutions??

socialite allows user information directly after successful authorization using

$user = socialite::driver('facebook')->user(); $user->email; 

i expect $user->email contain users email address if accepted share app , empty if user denied email address sharing.
, if $user->email empty throw error , ask user re-authorize. if it's not working try de-authroize user, guide can found here.


a convenient way avoid issues display warning user should allow email sharing if wants log in facebook.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -