I'm currently developing a web app using Laravel, and the app was working perfectly fine until recently. I had no idea what triggered it but here's a summary of the issue I'm having:
Logging in used to work as I have an AccountController that does this:
$auth = Auth::attempt(array(
'username' => Input::get('username'),
'password' => Input::get('password'),
'active'=>1);
if ($auth) {
return Redirect::route('home');
}
return Redirect::route('account-sign-in');
And the home route looks like so:
Route::get('/', array('as'=>'home', 'use'=>'HomeController@show'));
The app would usually return to home page immediately upon successful login. And in my home.blade.php, I would have an @if(Auth::check())
in place to make sure that once a user is logged in, the home page would serve a different set of texts.
Recently however, I noticed that after submitting a request to log in, there's an intermediate page showing a message "Redirecting to http://localhost.com/
". The message was not there prior to this, and the errors started showing up along with this message.
I looked up all the information I can online, and someone suggested that there were line break/space issues with the source code. I looked at all the source code I had and nothing would've suggested there's something wrong.
Desperate at the time, I removed Redirect::route('home') and replaced that with View::make('home') instead. That stopped the message from showing up, and I'm able to login as usual again.
So I have two questions: 1) what is causing this odd issue? 2) is there anything wrong with using View::make() in this case vs Redirect::route()?
Thanks!