Is the password in your database hashed? What is the size of the password field, it needs to be 60+ characters in size, if it's smaller you'll need to increase it and re-hash the password(s).
I think the Auth::attempt() method is not working because you are not passing an array.
Try something like
if (Auth::attempt(array('email' => Input::('email'), 'password' => Input::('password')))){
return Auth::user();
}
More info here
Try like this,
$credentials = $this->getLoginCredentials();
if (Auth::attempt($credentials)) { return Auth::user(); }
protected function getLoginCredentials() { return [ "username" => Input::get("username"), "password" => Input::get("password") ]; }
thanks for the replies gentlemen ill try out both solutions right now.
kumarramalingam, is all the code you posted suppose to be stored within the public function method i have in my controller?
masterakado said:
I think the Auth::attempt() method is not working because you are not passing an array.
Try something like
if (Auth::attempt(array('email' => Input::('email'), 'password' => Input::('password')))){ return Auth::user(); }
More info here
Im getting a syntax error saying there is an unexpected ')' i honestly cant find where it is ha....
afoster009 said:
masterakado said:
I think the Auth::attempt() method is not working because you are not passing an array.
Try something like
if (Auth::attempt(array('email' => Input::('email'), 'password' => Input::('password')))){ return Auth::user(); }
More info here
Im getting a syntax error saying there is an unexpected ')' i honestly cant find where it is ha....
Sorry my mistake just forgot the bracket after the password input try this
if (Auth::attempt(array('email' => Input::('email'), 'password' => Input::('password')))){
return Auth::user();
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community