jeudi 25 février 2016

laravel authentication always guest

I can successfully login as a user but it still receives auth as guest. I can not logout or login because it redirects me to the home page. I am using the pre built in authentication for users.The only file i have changed that is related to this issue is the routes file

Route::get('/', function () {
// return view('welcome');
if (Auth::check()) {
    return Auth::user();
}
else
{
    return 'guest';
}
});

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

// Registration routes...
Route::get('auth/register', 'Auth\AuthController@getRegister');
Route::post('auth/register', 'Auth\AuthController@postRegister');
Route::get('auth/logout', 'Auth\AuthController@getLogout');

});



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1VHBQFQ
via IFTTT

Aucun commentaire:

Enregistrer un commentaire