search for route('login') in your IDE you are obviously using it somewhere to get this error.
Laravel Route Authentication: "Route [login] not defined"?
Hi,
I'm developing software in Laravel and Passport that uses OAuth2 authentication with Canvas. It's to authenticate users, admins and non-users and see if they've permission to access a page.
However, when I try to make a request on this route, I get the following error message:
Symfony\Component\Routing\Exception\RouteNotFoundException: Route [login] not defined.
I don't understand why. Nowhere in my code do I call a "login" route, anywhere. Could anyone please offer some clarity on the subject? I'd be most grateful.
If it's of any use, here is my code in laravel for the route request:
Route::get('/testClient', ['as' => 'testClient', 'uses' => function(Request $request) {
$http = new GuzzleHttp\Client;
$response = $http->post('https://my.test.instructure.com/login/oauth2/auth?client_id=9&response_type=code&redirect_uri=http://www.google.com', [
'form_params' => [
'grant_type' => 'authorization_code',
'client_id' => 9,
'client_secret' => 'my_secret',
'redirect_uri' => 'www.google.com',
],
]);
return json_decode((string) $response->getBody(), true)['access_token'];
}])->middleware('client');
Nakov,
Thanks for linking that. While it did not have the answer, it helped me lead to it.
One of the major problems I had was that I hadn't configured the middleware correctly. I'd put the middleware definitions inside $middleware when they should have been in $routeMiddleware. Thank you for your help!
Please or to participate in this conversation.