Laravel login error 'Header can contain at most one header, newline detected by laravel login'
3 answers
I have the same problem. Observing closely, I noticed that the header that is being passed contains not only the newline char, but also the html code. Code for the page just undoing the redirect to the route I wanted to redirect.
My login is being redirected.
/**
* Where to redirect users after login.
*
* @return string
*/
protected function redirectTo()
{
return redirect()->route((string)\Auth::user()->group->type);
}
If there is already a named route for each type of group->.
I have already tried only returning to the route path without any success or any other error message.
[UPDATE] I found a fix here , changed the code to this and it worked:
protected function redirectTo()
{
// return redirect()->route((string)\Auth::user()->group->type);
return route(\Auth::user()->group->type);
}
+2
source to share