diff options
Diffstat (limited to 'app/models/concerns/token_authenticatable_strategies/encrypted.rb')
-rw-r--r-- | app/models/concerns/token_authenticatable_strategies/encrypted.rb | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/app/models/concerns/token_authenticatable_strategies/encrypted.rb b/app/models/concerns/token_authenticatable_strategies/encrypted.rb index 672402ee4d6..b59396a323c 100644 --- a/app/models/concerns/token_authenticatable_strategies/encrypted.rb +++ b/app/models/concerns/token_authenticatable_strategies/encrypted.rb @@ -85,18 +85,12 @@ module TokenAuthenticatableStrategies end def find_by_encrypted_token(token, unscoped) - nonce = Feature.enabled?(:dynamic_nonce_creation) ? find_hashed_iv(token) : Gitlab::CryptoHelper::AES256_GCM_IV_STATIC + nonce = Gitlab::CryptoHelper::AES256_GCM_IV_STATIC encrypted_value = Gitlab::CryptoHelper.aes256_gcm_encrypt(token, nonce: nonce) relation(unscoped).find_by(encrypted_field => encrypted_value) end - def find_hashed_iv(token) - token_record = TokenWithIv.find_by_plaintext_token(token) - - token_record&.iv || Gitlab::CryptoHelper::AES256_GCM_IV_STATIC - end - def insecure_strategy @insecure_strategy ||= TokenAuthenticatableStrategies::Insecure .new(klass, token_field, options) |