From 68780d29ad79627da94d805855254b43d354cfdf Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Tue, 4 Dec 2018 09:10:57 +0100 Subject: [PATCH] Fix token_set? method by checking migration status --- .../concerns/token_authenticatable_strategies/encrypted.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- GitLab