docs icon indicating copy to clipboard operation
docs copied to clipboard

[Quick Start] [PHP (Laravel)] email column in Users table can not be unique

Open hellojinjie opened this issue 5 years ago • 0 comments

Description

https://auth0.com/docs/quickstart/webapp/laravel#add-login-and-logout-links

If one user login with two different connection (e.g. github and google oauth2), he/she uses the same email in the two connection. Laravel will throw an execption:

Illuminate\Database\QueryException
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '[email protected]' for key 'users.users_email_unique' (SQL: insert into `users` (`sub`, `email`, `name`, `updated_at`, `created_at`) values (google-oauth2|xxxxxxxxxx, [email protected], , 2020-12-25 07:35:12, 2020-12-25 07:35:12))

My question is can you make email column non-unique?

Reproduction

Detail the steps taken to reproduce this error, what was expected, and whether this issue can be reproduced consistently or if it is intermittent.

Where applicable, please include:

  • Code sample to reproduce the issue
  • Log files (redact/remove sensitive information)
  • Application settings (redact/remove sensitive information)
  • Screenshots

Environment

Please provide the following:

"php": "^7.3|^8.0",
"auth0/login": "^6.1",
"aws/aws-sdk-php": "^3.171",
"doctrine/dbal": "^3.0",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.12",
"laravel/tinker": "^2.5"

hellojinjie avatar Dec 25 '20 07:12 hellojinjie