• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
->insert losing hash chars

#1
In CI4 I insert a hash 

$2y$10$trkKDMz5PR6xv0tV2UUoOeGpsIwMi5DEt6Hfvmc5RjcIsp2zeNXD.

When I look in the db it is

y$trkKDMz5PR6xv0tV2UUoOeGpsIwMi5DEt6Hfvmc5RjcIsp2zeNXD.

Here's the code:

} else {
$hashed_password = password_hash(trim($this->request->getPost('password')), PASSWORD_DEFAULT);
log_message('debug', $hashed_password);
$model = new \App\Models\UsersModel();
$model->insert([
'username' => trim($this->request->getPost('username')),
'password' => $hashed_password,
'email' => $this->request->getPost('email'),
'tpseq' => $this->request->getPost('tpseq'),
]);
redirect('/login');
}

Anyone have an idea of how can this be?

Also the ->first() method doesn't seem to work.
Simpler is always better
Reply


Messages In This Thread
->insert losing hash chars - by donpwinston - 06-10-2017, 12:26 AM
RE: ->insert losing hash chars - by kilishan - 06-11-2017, 02:39 PM
RE: ->insert losing hash chars - by donpwinston - 06-11-2017, 07:55 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.