codeigniter4 / shield

Authentication and Authorization for CodeIgniter 4
https://shield.codeigniter.com
MIT License
350 stars 123 forks source link

Bug: Redirect on failed activation check #630

Closed sammyskills closed 10 months ago

sammyskills commented 1 year ago

PHP Version

7.4

CodeIgniter4 Version

4.3.1

Shield Version

develop

Which operating systems have you tested for this bug?

Windows

Which server did you use?

apache

Database

MariaDB 10.4.18

Did you customize Shield?

No.

What happened?

When I tried to login with the details of an inactive user, I get redirected back to the login page, with the message:

You must activate your account before logging in.

Which is normal, but it comes with the following unanswered questions:

Steps to Reproduce

Login using the credentials of an inactive user.

Expected Output

I expect that the user is redirected to the account activation page, and the activation code resent to the user's email address.

Anything else?

This bug was fixed in #391, but was no longer implemented OR overtaken by #580. See https://github.com/codeigniter4/shield/blob/5f180c447c2e531d6c95adb700ecf26fee511573/src/Filters/SessionAuth.php#L52-L59

datamweb commented 1 year ago

@sammyskills Why Clouse?

sammyskills commented 1 year ago

Sorry, a mistake. I have reopened it again.

kenjis commented 11 months ago

Cannot reproduce.

--- a/app/Config/Auth.php
+++ b/app/Config/Auth.php
@@ -109,7 +109,7 @@ class Auth extends ShieldAuth
      * @var array<string, class-string<ActionInterface>|null>
      */
     public array $actions = [
-        'register' => null,
+        'register' => \CodeIgniter\Shield\Authentication\Actions\EmailActivator::class,
         'login'    => null,
     ];

Register a user.

Delete the session cookie in the browser.

Navigate to http://localhost:8080/login and Login.

Redirected to http://localhost:8080/index.php/auth/a/show, and see "We just sent an email to you with a code to confirm your email address. Copy that code and paste it below."

I get an email with activation code.

sammyskills commented 10 months ago

Closing this as the issue seem to have been solved in an update.