Feb 17, 2017
0
Level 1
changing guards from default doesn't make session and won't redirect properly
I defined a new guard with a new provider but although the attempt returns 'true' it doesn't make the session properly so it doesn't redirect properly to '/home' it still redirect to '/login', also the login form disappear. It's returns model data properly:
if(Auth::guard('company')->attempt(['email' => Input::get('email'), 'password' => Input::get('password')])){
$company = Auth::guard('company)->user(); //the model shows it's data
} else {
$company = null;
}
return view('home'); // no session, no redirect
Please or to participate in this conversation.