diff --git a/lib/Module.php b/lib/Module.php index e82122f..770fe5f 100644 --- a/lib/Module.php +++ b/lib/Module.php @@ -5,8 +5,9 @@ declare(strict_types=1); namespace KTXM\AuthenticationProviderPassword; use KTXC\Resource\ProviderManager; -use KTXF\Module\ModuleBrowserInterface; -use KTXF\Module\ModuleConsoleInterface; +use KTXF\Module\Configuration\BrowserModuleContextInterface; +use KTXF\Module\Configuration\ConsoleModuleContextInterface; +use KTXF\Module\Configuration\ModuleContextInterface; use KTXF\Module\ModuleInstanceAbstract; use KTXM\AuthenticationProviderPassword\Console\UserPasswordCommand; @@ -14,7 +15,7 @@ use KTXM\AuthenticationProviderPassword\Console\UserPasswordCommand; * Default Identity Provider Module * Provides local database authentication */ -class Module extends ModuleInstanceAbstract implements ModuleConsoleInterface, ModuleBrowserInterface +class Module extends ModuleInstanceAbstract { public function __construct( private readonly ProviderManager $providerManager, @@ -71,23 +72,13 @@ class Module extends ModuleInstanceAbstract implements ModuleConsoleInterface, M $this->providerManager->register('authentication', 'password', Provider::class); } - public function registerCI(): array + public function configure(ModuleContextInterface $context): void { - return [ - UserPasswordCommand::class, - ]; - } - - public function registerBI(): array - { - return [ - 'handle' => $this->handle(), - 'namespace' => 'AuthenticationProviderPassword', - 'version' => $this->version(), - 'label' => $this->label(), - 'author' => $this->author(), - 'description' => $this->description(), - 'boot' => 'static/module.mjs', - ]; + if ($context instanceof BrowserModuleContextInterface) { + $context->registerModule($this, 'AuthenticationProviderPassword', 'static/module.mjs'); + } + if ($context instanceof ConsoleModuleContextInterface) { + $context->registerCommand(UserPasswordCommand::class); + } } }