I am making a multi-auth custom login for clients. The login/logout works fine the first time I login, but shows this error in the second attempt
ErrorException in Response.php line 339: Header may not contain more than a single header, new line detected'
what may be the cause for this?
you should use
return route('admin.dashboard');
instead of
return redirect('admin/dashboard');
I'm facing same issue. Watching closely, I noticed that the header that is being passed contains not just a newline char, but also html code. A code for a page just annoucing the redirection to the route I wanted it to redirect.
My login is redirectTo is
/**
* Where to redirect users after login.
*
* @return string
*/
protected function redirectTo()
{
return redirect()->route((string)\Auth::user()->group->type);
}
Where already exists a named route for each group->type possible.
I've already tried just a return to the route path with no success or any different error message.
[UPDATE] I found a fix here, changed my code to this and it worked:
protected function redirectTo()
{
// return redirect()->route((string)\Auth::user()->group->type);
return route(\Auth::user()->group->type);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With