I'm using Larave 4.2, and everything works just fine. If I enter the correct credentials I will be taken to the correct URL (the one with auth
filter). But the problem I'm currently experiencing is when one of the fields entered is incorrect and the user submits it will show a white screen.
I've checked the filters, and quite sure it is still what came with Laravel and didn't change anything.
My routes file
https://gist.github.com/lozadaOmr/7621d309bdd08374381d
This is my User model
https://gist.github.com/lozadaOmr/b9b67c10e0874f1029b0
The controller used
Your controller login method has no branch for failed authentication. At the end of userLogin add another Redirect::back() or other logic
Some notes in the code block below...
/**
* Accepts the post request for login
* of user in CMS
*
*/
public function userLogin()
{
...
// returns validation object if fails, nothing if passes
// the single = looks off, but I normally don't make if's with var assignments in it
if ($errors = User::loginIsInvalid($user_credentials))
{
return Redirect::route('cms.login')->withInput()->withErrors($errors);
}
// if this passes then redirect to route('cms.home')
if (Auth::attempt(array(
'email' => $user_credentials['email'],
'password' => $user_credentials['password']), $remember_me))
{
return Redirect::route('cms.home');
}
// ??? what happens if auth fails it returns nothing, aka the white screen
}
Hope that helps
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community