I am using Socialite2.0 with Laravel5.3
Facebook and Google authentication are working well. With twitter, it fails because twitter is not sending back email id. The createOrGetUser() method is failing because email is null.
The error I am getting in laravel.log is
ERROR: exception 'PDOException' with message 'SQLSTATE: Integrity constraint violation: Column 'email' cannot be null' in ....../vendor/laravel/framework/src/Illuminate/Database/Connection.php
How to resolve this?
I understand FB and Google uses OAuth2 while Twitter is OAuth1 and hence things are slightly different.
Go to twitter developer's console.
In the permissions tab, scroll down to additional permissions.
Check: Request email addresses from users and click Update Settings
Terms of Service URL cannot be blank.
If your website doesn't already have such pages, you can easily create them using free templates available on the web.
Once you have the URLs ready, go to Settings tab and enter them.
Now you can check the option to request emails and save again.