예제 #1
0
 /**
  * Check if the given hash has been hashed using the given options.
  *
  * @param string $hashedValue
  * @param array $options
  *
  * @return bool
  */
 public function needsRehash($hashedValue, array $options = [])
 {
     // Here, we assume the target hasher is smart enough to detect if a
     // hash does not have the expected format.
     return $this->targetHasher->needsRehash($hashedValue, $options);
 }
예제 #2
0
 /**
  * Run before the command is handled.
  *
  * @param	Illuminate\Contracts\Hashing\Hasher
  * @param	Cerbero\Auth\Commands\Command	$command
  * @return	mixed
  */
 public function before(Hasher $hasher, $command)
 {
     if ($hasher->needsRehash($password = $command->attributes['password'])) {
         $command->attributes['password'] = $hasher->make($password);
     }
 }