lundi 10 octobre 2016

Laravel 5.3 keeps logging out

I'm working on a new app with laravel 5.3(.18) and for some reason the session keeps getting lost. After logging in (even with remember token) I get logged out as soon as I go to any other location, and therefore redirected to the login page again.

I have the following in routes/web.php

Auth::routes();

Route::get('/', function () {
    if( Auth::guest() ){
        return view('auth.login');
    }else{
        return view('welcome');
    }
});

Route::group(['middleware' => 'auth'], function () {
    Route::resource('orders', 'OrderController');
    Route::resource('products', 'ProductController');
    Route::get('/dashboard', 'DashboardController@show');
});

I already switched the session to 'database' in my env file and migrated.

Any ideas?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire