Support the ongoing development of Laravel.io →
Configuration Authentication Forms
Last updated 1 year ago.
0

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).

0

The password has a length of 64 characters

0

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

0

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") ]; }

0

thanks for the replies gentlemen ill try out both solutions right now.

0

kumarramalingam, is all the code you posted suppose to be stored within the public function method i have in my controller?

0

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....

Last updated 9 years ago.
0

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();
}

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.