codeigniter4 / shield

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

Bug: spark cli does not assign a default group to newly created user #998

Closed bgeneto closed 1 month ago

bgeneto commented 9 months ago

PHP Version

8.2.14

CodeIgniter4 Version

4.4.4

Shield Version

dev

Which operating systems have you tested for this bug?

Windows, Linux

Which server did you use?

apache

Database

MariaDB 10.2

Did you customize Shield?

No

What happened?

While creating a new user from the cli, the php spark shield:user create command does not assign any group to the user (if not using the group option/parameter). I think the command should assign a default group to the newly created user by using the following setting: config(\Config\AuthGroups::class)->defaultGroup in order to avoid possible permissions issues at the first login attempt.

Steps to Reproduce

php spark shield:user create

Username : bgeneto
Email : bgeneto@mail.com
Password : *******
Password confirmation : *******
User "bgeneto" created

Expected Output

A corresponding line in the auth_groups_users table using the default group from config(\Config\AuthGroups::class)->defaultGroup.

Anything else?

No response

kenjis commented 2 months ago

@bgeneto I sent PR #1162. Please check.