Skip to content

Commit 493ebc6

Browse files
committed
Removed old code
1 parent 303082b commit 493ebc6

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

src/Authentication/HMAC/HmacEncrypter.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@ public function __construct(bool $deprecatedKey = false)
4747
$authConfig = config('AuthToken');
4848
$config = new Encryption();
4949

50-
// // identify which encryption key should be used
51-
// $this->keyIndex = $deprecatedKey ? $authConfig->hmacDeprecatedKeyIndex : $authConfig->hmacKeyIndex;
52-
//
53-
// $config->key = $authConfig->hmacEncryptionKey[$this->keyIndex];
54-
// $config->driver = $authConfig->hmacEncryptionDriver[$this->keyIndex];
55-
// $config->digest = $authConfig->hmacEncryptionDigest[$this->keyIndex];
56-
5750
// identify which encryption key should be used
5851
$this->keyIndex = $deprecatedKey ? $authConfig->hmacEncryption['deprecatedKey'] : $authConfig->hmacEncryption['currentKey'];
5952

@@ -117,8 +110,7 @@ public function isEncrypted(string $string): bool
117110
*/
118111
public function isEncryptedWithSetKey(string $string): bool
119112
{
120-
return (bool) preg_match('/^\$b6\$' . $this->keyIndex . '\$/', $string);
121-
// return str_starts_with($string, '$b6$' . $this->keyIndex . '$');
113+
return preg_match('/^\$b6\$' . $this->keyIndex . '\$/', $string) === 1;
122114
}
123115

124116
/**

src/Config/AuthToken.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ protected function initEnvValue(&$property, string $name, string $prefix, string
150150
case 'hmacEncryption.driver':
151151
case 'hmacEncryption.digest':
152152
// if attempting to set property from ENV, first set to empty string
153-
if ((bool) $this->getEnvValue($name, $prefix, $shortPrefix)) {
154-
$property = null;
153+
if ($this->getEnvValue($name, $prefix, $shortPrefix) !== null) {
154+
$property = '';
155155
}
156156
}
157157

0 commit comments

Comments
 (0)