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

Using 'nova' middleware causes 401 #18

Open
lonnylot opened this issue Mar 2, 2020 · 2 comments
Open

Using 'nova' middleware causes 401 #18

lonnylot opened this issue Mar 2, 2020 · 2 comments

Comments

@lonnylot
Copy link

lonnylot commented Mar 2, 2020

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.

@nataliiaVasiuk
Copy link

@lonnylot Any decisions?
I have the same issue.

@jonrobinson
Copy link

jonrobinson commented Feb 16, 2021

@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');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants