*/ class SabrePluginAuthInitListener implements IEventListener { private AppAPIAuthBackend $authBackend; public function __construct(AppAPIAuthBackend $authBackend) { $this->authBackend = $authBackend; } public function handle(Event $event): void { if (!$event instanceof SabrePluginAuthInitEvent) { return; } $server = $event->getServer(); $authPlugin = $server->getPlugin('auth'); if ($authPlugin instanceof \Sabre\DAV\Auth\Plugin) { $authPlugin->addBackend($this->authBackend); } } }