lundi 21 septembre 2015

Laravel 5.1 login Multi Social Network with Socialite insert into the same name field

I would like to create login form using facebook, google, and twitter accounts. First step, I can create them by using Socialite Package. Second step, I can get user's info and insert into MySQL Database. My problem is I login successfully using facebook account for the first time and then I logout. After that I login with google account instead. The error occurred like this:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'users_email_unique' (SQL: insert into `users` (`name`, `updated_at`, `created_at`) values (SrengKhorn, 2015-09-22 02:44:26, 2015-09-22 02:44:26))

Here my users table : enter image description here

And I found that if I delete previous record with the same username I can login with any of them without error. Do you know to resolve this problem?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire