Home > Back-end >  Multi AUTH Laravel 8 web application Login issue(unexpected redirection)
Multi AUTH Laravel 8 web application Login issue(unexpected redirection)

Time:12-02

I am currently working with the Laravel 8 multi Auth web application.it has 5 types (admin , ecentre , ccentre ,farmer ,buyer) of account with different role.2 type user account created by admin (ecentre ,ccentre) and farmer and buyer account by using registration system in the authentication system. I used the Laravel livewire fortify authentication system.

my problem is one login to any type of account successfully login. Then log out system particular account and log in to the same account with no problem. But logout this account and log in different account with the correct credential do nothing(login request send but do not login) and stay on the login page. Then try it again login with the same user email and password successfully login. That is the real problem I have facing. Anyone facing this issue or any idea to solving this problem .(This issue is independent accentually user type. Every user type have the same issue )

I Check to inspect network tab both successes fail stage screen shoot

Failed Attempt Ststus Failed Attempt Screenshot

Success Attempt ScreenShot Succuss Attempt Screenshot

CodePudding user response:

I think the problem may not unset cookies or Session Use Session::flush(); to remove all session.Write it log out function

    public function getLogout() {
    
    ession::flush();
    auth()->logout();

    return redirect()->route('index');
}

This might be solve you problem. thank you!!

  • Related