Skip to content

Commit

Permalink
Allow passing options to password_hash().
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Jul 7, 2014
1 parent 8860e9b commit 4e4c125
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Auth/DefaultPasswordHasher.php
Expand Up @@ -9,7 +9,7 @@
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @since 2.4.0
* @since 3.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Auth;
Expand All @@ -28,7 +28,8 @@ class DefaultPasswordHasher extends AbstractPasswordHasher {
* @var array
*/
protected $_defaultConfig = [
'hashType' => PASSWORD_DEFAULT
'hashType' => PASSWORD_DEFAULT,
'hashOptions' => []
];

/**
Expand All @@ -39,7 +40,11 @@ class DefaultPasswordHasher extends AbstractPasswordHasher {
* @link http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#hashing-passwords
*/
public function hash($password) {
return password_hash($password, $this->_config['hashType']);
return password_hash(
$password,
$this->_config['hashType'],
$this->_config['hashOptions']
);
}

/**
Expand Down

0 comments on commit 4e4c125

Please sign in to comment.