Support the ongoing development of Laravel.io →
Authentication
Last updated 2 years ago.
0

Are you trying to pass $user variable to your controller ?

Can you post your complete code block.

Last updated 2 years ago.
0

//display login form Route::get('login', function(){ return View::make('login'); }); //login users Route::post('login', function(){ $user = array( 'username' => Input::get('email'), 'password' => Input::get('password') );

if (Auth::attempt($user)) {
	return Redirect::to('profile');
} else {
return Redirect::to('login')
		->with('login_errors', 'Your Email or Password is incorrect.');
}

});

Last updated 2 years ago.
0
  1. Are the passwords stored in their hashed form in your database?
  2. Is the password field in your database at least 60 characters in length?
Last updated 2 years ago.
0

The attempt method takes an array. How could it authenticate without passing in the password?

if (Auth::attempt(array('email' => $email, 'password' => $password)))
{
    return Redirect::intended('dashboard');
}
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.