samedi 5 mars 2016

Redirect Loop Issue on Logout Button Click Laravel 5.2.15

My Routes are like below

Route::group(['middleware' => ['web']], function () {
    Route::get('/', 'Auth\AuthController@getLogin');
    Route::post('auth/login', 'Auth\AuthController@postLogin');
    Route::get('auth/logout', 'Auth\AuthController@getLogout');
});

Route::group(['middleware' => ['web', 'auth']], function () {
    Route::get('/Roles', array('uses' => 'RoleController@Roles', 'as' => 'Roles'));
});

After successful authentiaction, I can see list of roles and there is logout button. Clicking on Logout button goes to class RedirectIfAuthenticated.

We have handle method in this class

public function handle($request, Closure $next, $guard = null)
{
    if (Auth::guard($guard)->check()) {
        return redirect('/');
    }
    return $next($request);
}

It goes inside if condition and here issue is coming.

Am I missing anything?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire