nova-ajax-select icon indicating copy to clipboard operation
nova-ajax-select copied to clipboard

Using 'nova' middleware causes 401

Open lonnylot opened this issue 5 years ago • 2 comments

Using the nova middleware is causing a 401:

Route::group(['middleware' => ['nova'], 'namespace' => 'Api'], function() {
    Route::get('city/{city}/neighborhoods', 'CityNeighborhoodController@show');
});

I am successfully logged in on Nova v2.11.1

When I take out the middleware it works correctly. I do not have any policies for the models or other auto for the controller.

lonnylot avatar Mar 02 '20 15:03 lonnylot

@lonnylot Any decisions? I have the same issue.

nataliiaVasiuk avatar Feb 01 '21 16:02 nataliiaVasiuk

@nataliiaVasiuk This is what works for me. Create a separate file for this route and update RouteServiceProvider.php

Route::prefix('api')
             ->middleware('nova')
             ->namespace($this->namespace)
             ->group(base_path('routes/api_nova.php'));

My Route:

Route::get('resources/{resource}/price-lists', 'ResourcePricelistController@list');

jonrobinson avatar Feb 16 '21 04:02 jonrobinson