Skip to content

Commit

Permalink
chore(deps): bump laravel/fortify from 1.18.1 to 1.19.1 (#7072)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexis Saettler <[email protected]>
  • Loading branch information
dependabot[bot] and asbiin authored Dec 25, 2023
1 parent 073781c commit 89cf285
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
15 changes: 2 additions & 13 deletions app/Actions/Fortify/PasswordValidationRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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(),
]);
}
}
13 changes: 13 additions & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
});
Expand Down
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 89cf285

Please sign in to comment.