framework icon indicating copy to clipboard operation
framework copied to clipboard

Route "login" does not exist while logged out

Open peter-mdf opened this issue 13 years ago • 3 comments

I've got a FAQ page protected with authorization like this:

// Auth
Route::get('/', '\controllers\AuthController@form');
Route::get('login', '\controllers\AuthController@form');

Route::group(array('before' => 'auth'), function() {            
            // FAQ
            Route::get('faq', '\controllers\FaqController@overview');
});

When I am logged in and I go to the FAQ page, everything works fine.

When I am logged off and I go to the FAQ page, I get this error:

RouteNotFoundException: Route "login" does not exist.

As you can see in my routing above, there is a login routing. Also,when directly calling localhost/login in my browser, I get the authorization form as stated in the routing.

So far I didn't find any mistake in my project or a setting I missed, so my guess is that this is a bug.

peter-mdf avatar Jan 27 '13 00:01 peter-mdf

Look at filters.php... the auth filter redirects to a login named route. If you're not logged in. You can change this behavior there.

taylorotwell avatar Jan 27 '13 02:01 taylorotwell

Damn... missed that. Sorry for making a report here.

peter-mdf avatar Jan 27 '13 12:01 peter-mdf

I created a pull request over at Symfony to make that error message a little clearer.

franzliedke avatar Jan 27 '13 18:01 franzliedke