Skip to content

Commit

Permalink
Refactor Auth configuration classes
Browse files Browse the repository at this point in the history
The commit encompasses changing the inheritance structure of certain classes in the Auth and Install directories. Notably, the AuthGroups and Publisher classes now extend from different source classes. Additionally, 'username' has been commented out in the validFields array in Auth.php, and AuthToken has been included in Install.php.
  • Loading branch information
kpeu3u committed Dec 12, 2023
1 parent cb13123 commit b54b746
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Auth/Config/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class Auth extends ShieldAuth
*/
public array $validFields = [
'email',
'username',
// 'username',
];

/**
Expand Down
5 changes: 3 additions & 2 deletions src/Auth/Config/AuthGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

namespace Bonfire\Auth\Config;

use CodeIgniter\Shield\Config\AuthGroups as ShieldGroups;
use CodeIgniter\Config\BaseConfig;
use CodeIgniter\Shield\Config\AuthGroups as ShieldAuthGroups;

class AuthGroups extends ShieldGroups
class AuthGroups extends ShieldAuthGroups
{
/**
* --------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions src/Auth/Config/AuthToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace Bonfire\Auth\Config;

use CodeIgniter\Config\BaseConfig;
use CodeIgniter\Shield\Config\AuthToken as ShieldAuthToken;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Commands/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class Install extends BaseCommand
'Bonfire\Assets\Config\Assets',
'Bonfire\Auth\Config\Auth',
'Bonfire\Auth\Config\AuthGroups',
'Bonfire\Auth\Config\AuthToken',
'Bonfire\Config\Bonfire',
'Bonfire\Config\Site',
'Bonfire\Config\Themes',
Expand Down
1 change: 1 addition & 0 deletions src/Commands/Install/Publisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function publishClass(string $className): void
$namespace => 'Config',
'BaseConfig' => 'Bonfire' . $rawClassName,
'use CodeIgniter\Config\BaseConfig;' => "use {$className} as Bonfire{$rawClassName};",
"class {$rawClassName} extends Shield{$rawClassName}" => "class {$rawClassName} extends Bonfire{$rawClassName}",
];

if ($className === 'Bonfire\Assets\Config\Assets') {
Expand Down
1 change: 0 additions & 1 deletion src/Config/Bonfire.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class Bonfire extends BaseConfig
* Menu Users and the menus belonging to custom modules can be arranged
* this way, as well as the submenus of Tools and Settings. The placement
* of menus Tools and Settings will not be affected by this setting.
*
*/
public $menuWeights = [];
}

0 comments on commit b54b746

Please sign in to comment.