codeigniter4 / shield

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

Bug: Broken register #386

Closed jozefrebjak closed 2 years ago

jozefrebjak commented 2 years ago

PHP Version

8.1.9

CodeIgniter4 Version

4.2.4

Shield Version

dev-develop

Which operating systems have you tested for this bug?

macOS, Linux

Which server did you use?

fpm-fcgi

Database

MariaDB 10.8.3

Did you customize Shield?

No

What happened?

After updating to the latest dev-develop is registration of new users via /register route broken. It seems like no auth_identity is created during registration.

Steps to Reproduce

Just follow install docs and try to register as a new user via /register route. We are redirected to app, but in database is no entry in auth_identities table.

Expected Output

After registration of the new user create identity.

Anything else?

No response

datamweb commented 2 years ago

@jozefrebjak, I could not reproduce!

Data of Table "test__auth_identities":

+----+---------+----------------+------+--------------------+--------------------+---------+-------+-------------+--------------------+--------------------+--------------------+
| id | user_id | type           | name | secret             | secret2            | expires | extra | force_reset | last_used_at       | created_at         | updated_at         |
+----+---------+----------------+------+--------------------+--------------------+---------+-------+-------------+--------------------+--------------------+--------------------+
| 12 | 8       | email_password |      | pooya_parsa_dad... | $2y$10$u2ergbH2... |         |       | 0           | 2022-08-16 06:4... | 2022-08-16 05:3... | 2022-08-16 06:4... |
| 35 | 9       | email_password |      | jozef@yahoo.com    | $2y$10$GT.1rW0L... |         |       | 0           |                    | 2022-08-16 09:2... | 2022-08-16 09:2... |
+----+---------+----------------+------+--------------------+--------------------+---------+-------+-------------+--------------------+--------------------+--------------------+
jozefrebjak commented 2 years ago

@datamweb What I did. I did rollback of the database. Then I migrated with php spark migrate -all, went to /register and just registered user, I was redirected to app, but after logout I can't login. My auth_identities is empty. OK, I tested it in another app and it's fine, so I need to find what is wrong in my app with this.

datamweb commented 2 years ago

@jozefrebjak I will keep this issue open for the next few days. If you reproduce, let me know.

Thank you for being with the team.

jozefrebjak commented 2 years ago

@datamweb I already fixed the issue. I spent some time to fix it, but I think a problem was with my extended config, entity and model.

datamweb commented 2 years ago

Hello , No problem, thanks for letting us know.