@@ -174,7 +174,7 @@ |
||
| 174 | 174 | private function doChecks(string $value, string $key): bool |
| 175 | 175 | { |
| 176 | 176 | return $this->tokenIsValid($value, $key) && |
| 177 | - $this->tokenIsExpired($key) && |
|
| 177 | + $this->tokenIsExpired($key) && |
|
| 178 | 178 | $this->deleteToken($key); |
| 179 | 179 | } |
| 180 | 180 | |
@@ -122,7 +122,7 @@ |
||
| 122 | 122 | //current time |
| 123 | 123 | $time = \time(); |
| 124 | 124 | |
| 125 | - for ($i = $size -1; $i > -1; $i--) { |
|
| 125 | + for ($i = $size - 1; $i > -1; $i--) { |
|
| 126 | 126 | //get token from storage |
| 127 | 127 | //if token in storage doesn't match user token continue |
| 128 | 128 | if (($tmpToken = \substr($tokens[$i], 0, $chars)) !== $token) { |
@@ -174,7 +174,7 @@ |
||
| 174 | 174 | $size = \count($nonces); |
| 175 | 175 | |
| 176 | 176 | //try to decrypt starting from last stored nonce |
| 177 | - for ($i = $size -1; $i > -1; $i--) { |
|
| 177 | + for ($i = $size - 1; $i > -1; $i--) { |
|
| 178 | 178 | //for successful decryption return true |
| 179 | 179 | if (($tmpPlainText = \sodium_crypto_aead_xchacha20poly1305_ietf_decrypt($encryptedToken, '', $nonces[$i], $key))) { |
| 180 | 180 | //plainText will remain string if sodium_crypto return false |