lundi 19 août 2019

Laravel Auth Does not redirect back after incorrect login/registration

Im using default Laravel 5.8 authentication model. It worked fine, but recently I noticed that after I enter wrong credentials in login form, it still redirects me to homepage, in the corner browser asks me if I want to save password and etc. Everything looks like I was logged in, but Im not.

If I enter correct information, then I get logged in and everything works fine.

I was looking for a solutions, but everything I could find was modifying LoginController and RegisterController, but I think I dont want to do that, cause default behavior is what I need, so problem must be somewhere else.

I dont know what code to show, all I guess what could be related is :

web.php

Route::get('logout', 'Auth\LoginController@logout');

Auth::routes(['verify' => true]);

app/Http/Kernel.php middleware groups


protected $middlewareGroups = [
        'web' => [
            \App\Http\Middleware\EncryptCookies::class,
            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
            \Illuminate\Session\Middleware\StartSession::class,
            // \Illuminate\Session\Middleware\AuthenticateSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            \App\Http\Middleware\VerifyCsrfToken::class,
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
        ],

        'admin' => [
            \App\Http\Middleware\Administrator::class,
        ],

        'api' => [
            'throttle:60,1',
            'bindings',
        ],
    ];

What I expect: to be redirected back to same page after incorrect login/registration.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2Mq9s06
via IFTTT

Aucun commentaire:

Enregistrer un commentaire