3 namespace wcf\system\user\authentication\configuration;
5 use wcf\system\appmaker\app\preset\event\ConfigurationLoading;
6 use wcf\system\event\EventHandler;
7 use wcf\system\SingletonFactory;
10 * Provides the instance of the active configuration of the user authentication process.
13 * @copyright 2001-2023 WoltLab GmbH
14 * @license WoltLab License <http://www.woltlab.com/license-agreement.html>
16 final class UserAuthenticationConfigurationFactory extends SingletonFactory
18 private UserAuthenticationConfiguration $configuration;
21 protected function init()
23 $this->configuration = $this->getDefaultConfiguration();
25 $event = new ConfigurationLoading();
26 EventHandler::getInstance()->fire($event);
27 if ($event->getConfigration()) {
28 $this->configuration = $event->getConfigration();
32 public function getConfigration(): UserAuthenticationConfiguration
34 return $this->configuration;
37 private function getDefaultConfiguration(): UserAuthenticationConfiguration
39 return new UserAuthenticationConfiguration(