D
D
Dmitry Kuznetsov2016-05-07 17:18:06
Laravel
Dmitry Kuznetsov, 2016-05-07 17:18:06

Laravel 5 authorization not working?

I decided to switch from Angular to Laravel 5 again, and here it is ... I
wrote a simple authorization, in theory, everything works - it gives the data of the authorized user (via dd(Auth::user())), but after updating the page it disappears , as if not even authorized (
I read on the Toaster, they say it's about sessions and you need to use middleware web, but I use them, but there's no point.
Route:

Route::get('/', ['as' => 'index', 'uses' => '[email protected]']);

Route::group(['prefix' => 'auth'], function(){
    Route::get('login', ['as' => 'auth.getLogin', 'uses' => 'Auth\[email protected]']);
    Route::post('login', ['as' => 'auth.postLogin', 'uses' => 'Auth\[email protected]']);
    Route::get('register', ['as' => 'auth.getRegister', 'uses' => 'Auth\[email protected]']);
});

If any more information is needed, I'll post it. I just think it's a matter of routes. But how to solve - xs(
Thank you in advance for your help.
PS: I'm working on a local computer. It doesn't display any errors. Sessions work. Middleware => web is no longer necessary to write.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Kuznetsov, 2016-05-15
@dima9595

Decided! My mistake was that I did not change the User model - I did not change the incoming data)

S
Stanislav Pochepko, 2016-05-07
@DJZT

Check the permissions on the storage folder. Must be 777 or 755

O
Omniverse, 2016-05-08
@Omniverse

Try removing web middleware from routes. In 5.2, it is added by default to every route, so it turns out that you are using it the second time and because of this there may be errors.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question