datamweb / shield-oauth

OAuth for CodeIgniter Shield
https://www.shield-oauth.codeigniter4.ir/
MIT License
61 stars 16 forks source link

Bug: Handle Soft-Deleted Users in OAuth Login to Prevent Duplicate Entry Errors #173

Open kanglalaw opened 1 month ago

kanglalaw commented 1 month ago

PHP Version

8.2.22

CodeIgniter4 Version

4.5.4

Shield Version

1.1.0

Shield OAuth Version?

dev-develop

Which operating systems have you tested for this bug?

Windows

Which server did you use?

apache

Database

MySQL 8.0.30

Did you add customize OAuth?

YES, For Facebook Login, following documentation for Login with Yahoo

What happened?

Issue Description

I am encountering a problem when a user who has been soft-deleted attempts to log in using OAuth (Google). I receive the following error:

Screenshot_112

Steps to Reproduce

  1. Soft delete a user.
  2. The user attempts to log in again using OAuth (Google) with the same email.

Expected Output

I would expect the system to handle this situation gracefully, either by permanently deleting the entry for the soft-deleted user or by reactivating the user when they attempt to log in again, or by displaying a notification that the user has previously registered and been deleted by an admin, prompting them to contact the admin for further assistance.

Anything else?

log-2024-09-27 copy.log