This class loads the defined encoder and uses it to create a hash from the submitted password and verifies if it matches the password from the user provider.
Inheritance: use trait Webiny\Component\StdLib\StdLibTrait, use trait Webiny\Component\StdLib\FactoryLoaderTrait
示例#1
0
 /**
  * Verify if the $password matches the $hash.
  *
  * @param string $password
  * @param string $hash
  *
  * @return bool True if $password matches $hash. Otherwise false is returned.
  */
 public function verifyPasswordHash($password, $hash)
 {
     return $this->encoder->verifyPasswordHash($password, $hash);
 }
示例#2
0
 public function testVerifyPasswordHashFalse()
 {
     $encoder = new Encoder('\\Webiny\\Component\\Security\\Tests\\Mocks\\EncoderMock');
     $this->assertFalse($encoder->verifyPasswordHash('admin', 'password'));
 }