wagnerdelima / drf-social-oauth2

drf-social-oauth2 makes it easy to integrate Django social authentication with major OAuth2 providers, i.e., Facebook, Twitter, Google, etc.
https://drf-social-oauth2.readthedocs.io/en/latest/
MIT License
269 stars 34 forks source link

Handle IntegrityError for Duplicate Email Entries #190

Closed dlintin closed 1 year ago

dlintin commented 1 year ago

Description

This pull request includes a change to our error handling logic to account for IntegrityError exceptions that are raised when a duplicate email entry is attempted.

When a IntegrityError is caught, the code checks if it's due to a duplicate email. If so, it returns a 400 Bad Request response with an appropriate error message. If the IntegrityError is for a different reason, it still returns a 400 Bad Request response, but with a more general 'Database error' message.

Fixes # (issue)

Checklist

dlintin commented 1 year ago

Hi @wagnerdelima, i don't need to update the version right?

wagnerdelima commented 1 year ago

You don´t. This is done by me once I release a new version.

dlintin commented 1 year ago

Hi @wagnerdelima, sorry to bother you with this, but can we make the new release on this as soon as possible? I really need this feature for production. Thank You!