Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [workflow_dispatch, push, pull_request]

jobs:
run:
uses: flarum/framework/.github/workflows/REUSABLE_backend.yml@1.x
uses: flarum/framework/.github/workflows/REUSABLE_backend.yml@2.x
with:
enable_backend_testing: false
enable_phpstan: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ on: [workflow_dispatch, push, pull_request]

jobs:
run:
uses: flarum/framework/.github/workflows/REUSABLE_frontend.yml@1.x
uses: flarum/framework/.github/workflows/REUSABLE_frontend.yml@2.x
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: true

frontend_directory: ./js
backend_directory: .
js_package_manager: npm
main_git_branch: 1.x
js_package_manager: yarn
main_git_branch: 2.x

secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
25 changes: 11 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,15 @@
}
],
"require": {
"flarum/core": "^1.6.0",
"google/recaptcha": "^1.2"
"flarum/core": "^2.0.0",
"google/recaptcha": "^1.3"
},
"authors": [
{
"name": "Sajjad Hashemian",
"email": "wolaws@gmail.com"
},
{
"name": "David Sevilla Martín",
"email": "david.s@redevs.org",
"role": "Developer"
"name": "FoF Team",
"homepage": "https://friendsofflarum.org"
}
],
"replace": {
"sijad/flarum-ext-recaptcha": "*"
},
"autoload": {
"psr-4": {
"FoF\\ReCaptcha\\": "src/"
Expand All @@ -61,16 +53,21 @@
"modules": {
"githubActions": true
}
},
"branch-alias": {
"dev-2.x": "2.x-dev"
}
},
"require-dev": {
"flarum/phpstan": "*"
"flarum/phpstan": "^2.0.0"
},
"scripts": {
"analyse:phpstan": "phpstan analyse",
"clear-cache:phpstan": "phpstan clear-result-cache"
},
"scripts-descriptions": {
"analyse:phpstan": "Run static analysis"
}
},
"minimum-stability": "beta",
"prefer-stable": true
}
23 changes: 18 additions & 5 deletions extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
namespace FoF\ReCaptcha;

use Flarum\Api\ForgotPasswordValidator;
use Flarum\Api\Serializer\ForumSerializer;
use Flarum\Api\Resource\DiscussionResource;
use Flarum\Api\Resource\ForumResource;
use Flarum\Api\Resource\PostResource;
use Flarum\Api\Resource\UserResource;
use Flarum\Discussion\Event\Saving as DiscussionSaving;
use Flarum\Extend;
use Flarum\Forum\LogInValidator;
Expand All @@ -36,19 +39,29 @@
->default('fof-recaptcha.signup', true)
->default('fof-recaptcha.signin', true)
->default('fof-recaptcha.forgot', true)
->serializeToForum('theme_dark_mode', 'theme_dark_mode', 'boolVal')
->default('fof-recaptcha.type', 'checkbox')
->default('fof-recaptcha.v3_threshold', 0.5)
->serializeToForum('fof-recaptcha.credentials.site', 'fof-recaptcha.credentials.site')
->serializeToForum('fof-recaptcha.type', 'fof-recaptcha.type')
->serializeToForum('fof-recaptcha.signup', 'fof-recaptcha.signup', 'boolVal')
->serializeToForum('fof-recaptcha.signin', 'fof-recaptcha.signin', 'boolVal')
->serializeToForum('fof-recaptcha.forgot', 'fof-recaptcha.forgot', 'boolVal'),

(new Extend\ApiResource(ForumResource::class))
->fields(Api\ForumResourceFields::class),

(new Extend\ApiResource(DiscussionResource::class))
->fields(Api\RecaptchaFields::class),

(new Extend\ApiResource(PostResource::class))
->fields(Api\RecaptchaFields::class),

(new Extend\ApiResource(UserResource::class))
->fields(Api\RecaptchaFields::class),

(new Extend\Routes('api'))
->post('/fof/recaptcha/test', 'fof-recaptcha.test', Api\Controller\TestReCaptchaController::class),

(new Extend\ApiSerializer(ForumSerializer::class))
->attributes(ForumAttributes::class),

(new Extend\Validator(RecaptchaValidator::class))
->configure(AddValidatorRule::class),

Expand Down
File renamed without changes.
File renamed without changes.
Loading
Loading