I started a new Laravel 5.2 project using laravel new MyApp and adding authentication via php artisan make:auth . This is only for the website in which the first user loads and creates the rest (without manually creating the user / password reset / etc.).
These are the routes that I have currently defined:
Route::group(['middleware' => 'web'], function () { // Authentication Routes... Route::get( 'user/login', ['as' => 'user.login', 'uses' => 'Auth\ AuthController@showLoginForm ']); Route::post('user/login', ['as' => 'user.doLogin', 'uses' => 'Auth\ AuthController@login ' ]); Route::group(['middleware' => 'auth'], function() { // Authenticated user routes Route::get( '/', ['as'=>'home', 'uses'=> ' HomeController@index ']); Route::get( 'user/{uid?}', ['as' => 'user.profile', 'uses' => 'Auth\ AuthController@profile ' ]); Route::get( 'user/logout', ['as' => 'user.logout', 'uses' => 'Auth\ AuthController@logout ' ]); Route::get( '/user/add', ['as' => 'user.add', 'uses' => 'Auth\ AuthController@showAddUser ']); [...] }); });
I can log into the system just fine, but I experience some very “funky” behavior - when I try to log out (through the built-in logout method that was created using the wizard), the page redirects 302 to home, and I'm still logged in.
What more, while almost all pages (not listed here) work as expected, user.add also creates 302 on the home page.
Note that the main page is declared by AuthController as $redirectTo , if that matters
I found out about forwarding via debugbar. Any idea what to look for?
source share