diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-12-04 09:10:57 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-12-04 09:10:57 +0100 |
commit | 68780d29ad79627da94d805855254b43d354cfdf (patch) | |
tree | 015a791db7c885f20d9040401d9d936fd4d8f57d | |
parent | 239a4f72642b2df0cc057a17daadf1391332d118 (diff) | |
download | gitlab-ce-68780d29ad79627da94d805855254b43d354cfdf.tar.gz |
Fix token_set? method by checking migration status
-rw-r--r-- | app/models/concerns/token_authenticatable_strategies/encrypted.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/concerns/token_authenticatable_strategies/encrypted.rb b/app/models/concerns/token_authenticatable_strategies/encrypted.rb index 2e65a2b6b22..86f7f52f42c 100644 --- a/app/models/concerns/token_authenticatable_strategies/encrypted.rb +++ b/app/models/concerns/token_authenticatable_strategies/encrypted.rb @@ -88,7 +88,10 @@ module TokenAuthenticatableStrategies def token_set?(instance) raw_token = instance.read_attribute(encrypted_field) - raw_token ||= (insecure_strategy.get_token(instance) if fallback?) + + unless fully_encrypted? + raw_token ||= insecure_strategy.get_token(instance) + end raw_token.present? end |