diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 78c7b9b..2f9fd17 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -8,5 +8,6 @@ jobs: with: enable_backend_testing: true enable_phpstan: true + php_versions: '["7.4", "8.0, "8.1", "8.2", "8.3"]' backend_directory: . diff --git a/composer.json b/composer.json index 0c9e698..39e79aa 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,7 @@ } ], "require": { + "php": "^7.4 || ^8.0", "flarum/core": "^1.8.1", "league/oauth1-client": "^1.10.1", "league/oauth2-facebook": "^2.2.0", @@ -71,7 +72,10 @@ "name": "fas fa-sign-in-alt", "backgroundColor": "#e74c3c", "color": "#fff" - } + }, + "optional-dependencies": [ + "flarum/gdpr" + ] }, "flagrow": { "discuss": "https://discuss.flarum.org/d/25182" diff --git a/extend.php b/extend.php index c16aca0..caaa245 100644 --- a/extend.php +++ b/extend.php @@ -80,4 +80,12 @@ (new Extend\SimpleFlarumSearch(UserSearcher::class)) ->addGambit(Query\SsoIdFilterGambit::class), + + (new Extend\Conditional()) + ->whenExtensionEnabled('flarum-gdpr', fn () => [ + (new Extend\ApiSerializer(ForumSerializer::class)) + ->attribute('passwordlessSignUp', function (ForumSerializer $serializer) { + return !$serializer->getActor()->isGuest() && $serializer->getActor()->loginProviders()->count() > 0; + }), + ]), ];