Support the ongoing development of Laravel.io →
Authentication
Last updated 2 years ago.
0

Having the same issues.

0

Found a work around which I'm not sure is the right thing to do. I realized that my getLogin() isn't even called if the user is logged in, (I don't know why). So this is what I did.

In the AuthController.php\__construct():

if (\Auth::check())
{
    return redirect()->intended('/dashboard');
}

and same two lines in the AuthController.php\getLogin():

if (\Auth::check())
{
    return redirect()->intended('/dashboard');
}

Hope this helps.

0

You have to change the redirect value in handle method of app\Http\Middleware\RedirectIfAuthenticated.php

public function handle($request, Closure $next)
{
    if ($this->auth->check()) {
        return redirect('/home');
    }

    return $next($request);
}
0

it worked for me .apply this logic:

   Route::get('/', ['middleware' => 'auth', function (){

    if(Auth::check())
    {
        return redirect()->action('BrandController@index');
    }
    }]);
0

Sign in to participate in this thread!

Eventy

Your banner here too?

gmanish gmanish Joined 3 Aug 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.