diff --git a/app/Actions/Fortify/PasswordValidationRules.php b/app/Actions/Fortify/PasswordValidationRules.php index 48ab6d60694..73338a75fa6 100644 --- a/app/Actions/Fortify/PasswordValidationRules.php +++ b/app/Actions/Fortify/PasswordValidationRules.php @@ -2,8 +2,7 @@ namespace App\Actions\Fortify; -use Illuminate\Support\Facades\App; -use Laravel\Fortify\Rules\Password; +use Illuminate\Validation\Rules\Password; trait PasswordValidationRules { @@ -12,21 +11,11 @@ trait PasswordValidationRules */ protected function passwordRules(bool $confirmed = true): array { - $rules = (new Password)->length(4); - - if (App::environment('production')) { - // @codeCoverageIgnoreStart - $rules->length(8) - ->requireUppercase() - ->requireNumeric(); - // @codeCoverageIgnoreEnd - } - return array_filter([ 'nullable', 'string', $confirmed ? 'confirmed' : null, - $rules, + Password::default(), ]); } } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index df6091bf750..fd33cc9f2e6 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -15,6 +15,7 @@ use Illuminate\Support\ServiceProvider; use Illuminate\Support\Str; use Illuminate\Testing\TestResponse; +use Illuminate\Validation\Rules\Password; use LaravelWebauthn\Facades\Webauthn; use League\CommonMark\Environment\Environment; use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension; @@ -105,6 +106,18 @@ public function register() */ public function boot() { + Password::defaults(function () { + return $this->app->environment('production') + // @codeCoverageIgnoreStart + ? Password::min(8) + ->letters() + ->mixedCase() + ->numbers() + ->symbols() + // @codeCoverageIgnoreEnd + : Password::min(4); + }); + RateLimiter::for('oauth2-socialite', function (Request $request) { return Limit::perMinute(5)->by(optional($request->user())->id ?: $request->ip()); }); diff --git a/composer.lock b/composer.lock index 74151394f7b..7e69ead5854 100644 --- a/composer.lock +++ b/composer.lock @@ -2485,16 +2485,16 @@ }, { "name": "laravel/fortify", - "version": "v1.18.1", + "version": "v1.19.1", "source": { "type": "git", "url": "https://github.com/laravel/fortify.git", - "reference": "a3aaf020ac76cd546658517126ddd58d1627d3d0" + "reference": "1dde858a520f679b4a2f453fa68f8a0e98751875" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/fortify/zipball/a3aaf020ac76cd546658517126ddd58d1627d3d0", - "reference": "a3aaf020ac76cd546658517126ddd58d1627d3d0", + "url": "https://api.github.com/repos/laravel/fortify/zipball/1dde858a520f679b4a2f453fa68f8a0e98751875", + "reference": "1dde858a520f679b4a2f453fa68f8a0e98751875", "shasum": "" }, "require": { @@ -2545,7 +2545,7 @@ "issues": "https://github.com/laravel/fortify/issues", "source": "https://github.com/laravel/fortify" }, - "time": "2023-10-18T14:10:08+00:00" + "time": "2023-12-11T16:16:45+00:00" }, { "name": "laravel/framework",