0
Good morning
I need to free a REST service on a system with authentication, in Laravel 5.1, so when I access the REST address in a place that is not authenticated, it asks to enter login and password, but this service will not need authentication, because it will be used by another system of our own company for small consultations.
Is there any way to clear a route on Laravel that doesn’t pass the authentication that already exists? Everything I try to do the system forwards to the login page and password to authenticate, before I can use the service.
Thanks in advance
You are checking the User in the Routes.php? file to post an example of the route you are using?
– Jao Assy
I believe it’s some class that’s extended by the controller, so I couldn’t dig any deeper. I don’t think it’s done on the route, because on route.php there are routes like this, which still asks for authentication: Route::get('/test', ['as' => 'client.test', 'uses' => 'Clientcontroller@test']);
– Isaias Lima
Check whether in the controller or Extended Parent constructor you make use of middleware, for example: $this->middleware('auth');
– Jao Assy
The route you need to clear is within some group of routes (Route::group()) ?
– lstonon
Jao Assy, I didn’t find this use of middleware, but because of it I was able to discover the Redirectifauthenticated.php class, in App/Http/Middleware that in this case was controlling the authentication exceptions. Really worth it
– Isaias Lima