mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Fixes ACCOUNTS-2. Catch decryption exception for OAuth2 flow
This commit is contained in:
@@ -107,6 +107,13 @@ class Component extends BaseComponent {
|
||||
return $cipher;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $encryptedValue
|
||||
*
|
||||
* @return string
|
||||
* @throws \SodiumException
|
||||
* @throws \RangeException
|
||||
*/
|
||||
public function decryptValue(string $encryptedValue): string {
|
||||
$decoded = Base64UrlSafe::decode($encryptedValue);
|
||||
Assert::true(mb_strlen($decoded, '8bit') >= (SODIUM_CRYPTO_SECRETBOX_NONCEBYTES + SODIUM_CRYPTO_SECRETBOX_MACBYTES));
|
||||
|
Reference in New Issue
Block a user