Skip to content

Commit

Permalink
add security to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio committed Mar 7, 2024
1 parent 9c1d19f commit 9b2ef47
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
use App\Filament\Pages\Auth\Settings;
use App\Models\User;
use Carbon\Carbon;
use Dedoc\Scramble\Scramble;
use Dedoc\Scramble\Support\Generator\OpenApi;
use Dedoc\Scramble\Support\Generator\SecurityScheme;
use Filament\Facades\Filament;
use Filament\Navigation\UserMenuItem;
use Illuminate\Database\Eloquent\Model;
Expand Down Expand Up @@ -58,6 +61,12 @@ public function boot()
Gate::define('viewApiDocs', function (User $user) {
return $user->canAccessFilament() && $user->isPlatformAdmin();
});

Scramble::extendOpenApi(function (OpenApi $openApi) {
$openApi->secure(
SecurityScheme::http('bearer', 'JWT')
);
});
}

public function registerReleaseVersion(): void
Expand Down

0 comments on commit 9b2ef47

Please sign in to comment.