Remove deprecated fortify password policy and add a stricter one
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Providers;
|
||||
use App\Models\PersonalAccessToken;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Validation\Rules\Password;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
@@ -15,6 +16,14 @@ class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
Sanctum::usePersonalAccessTokenModel(PersonalAccessToken::class);
|
||||
|
||||
Password::defaults(function () {
|
||||
$rule = Password::min(8);
|
||||
|
||||
return $this->app->isProduction()
|
||||
? $rule->mixedCase()->letters()->numbers()->symbols()
|
||||
: $rule;
|
||||
});
|
||||
|
||||
Http::macro('github', function (string $api_url, ?string $github_access_token = null) {
|
||||
if ($github_access_token) {
|
||||
return Http::withHeaders([
|
||||
|
||||
Reference in New Issue
Block a user