php - laravel Hash::make keep giving a different results -
i want utilize authentication in laravel 4 changed table's , mobel's name
when user register, has password , save it, hash :
$password = hash::make(input::get('password'));
and when user login want ot authenticate him/her first. this:
if (auth::attempt(array('username' => input::get('usernaem'), 'password' => hash::make(input::get('password'))))) { homecoming redirect::intended('dashboard'); }
and never success. tried debug code , seems hask::make
function give different result.
am using authentication methods? solution hash function ?
many thanks
at first, don't utilize hash
when attempting, should this:
auth::attempt(array('username' => input::get('username'), 'password' => input::get('password')));
since stored password in database manually making hash using hash::make()
, pasted in database. problem. re-enter password database , insert pragmatically, seek again.
also, may check password using hash::check('password', $hashedpassword)
. read more security on laravel
website. utilize migration populate false data, don't manually set info database.
php laravel laravel-4 blade
No comments:
Post a Comment