Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Laravel Nova authentication middleware to API routes #433

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function fields(Request $request)
If you upload the same media files to multiple models and you do not want to select it from the file system
all over again, use this feature. Selecting an already existing media will **copy it**.

**Attention**: This feature will expose an endpoint to every user of your application to search existing media.
**Attention**: This feature will expose an endpoint to every Nova authenticated user of your application to search existing media.
If your media upload / custom properties on the media models are confidential, **do not enable this feature!**

* Publish the config files if you did not yet
Expand Down
3 changes: 2 additions & 1 deletion src/AdvancedNovaMediaLibraryServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Laravel\Nova\Nova;
use Laravel\Nova\Events\ServingNova;
use Illuminate\Support\ServiceProvider;
use Laravel\Nova\Http\Middleware\Authenticate;

class AdvancedNovaMediaLibraryServiceProvider extends ServiceProvider
{
Expand Down Expand Up @@ -33,7 +34,7 @@ protected function routes()
return;
}

Route::middleware(['nova'])
Route::middleware(['nova', Authenticate::class])
->prefix('nova-vendor/ebess/advanced-nova-media-library')
->group(__DIR__.'/../routes/api.php');
}
Expand Down