summaryrefslogtreecommitdiff
path: root/app/models/concerns
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-12-03 14:29:51 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-12-03 14:29:51 +0100
commit239a4f72642b2df0cc057a17daadf1391332d118 (patch)
treed88b8cd131d056f38bad3188487ac0ef63d9044c /app/models/concerns
parente9abacedb01efdb127580dae54a6ffbe8c8c1399 (diff)
downloadgitlab-ce-239a4f72642b2df0cc057a17daadf1391332d118.tar.gz
Use plaintext token when migration is not complete
Diffstat (limited to 'app/models/concerns')
-rw-r--r--app/models/concerns/token_authenticatable_strategies/encrypted.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/models/concerns/token_authenticatable_strategies/encrypted.rb b/app/models/concerns/token_authenticatable_strategies/encrypted.rb
index 1f752850aad..2e65a2b6b22 100644
--- a/app/models/concerns/token_authenticatable_strategies/encrypted.rb
+++ b/app/models/concerns/token_authenticatable_strategies/encrypted.rb
@@ -12,16 +12,18 @@ module TokenAuthenticatableStrategies
def find_token_authenticatable(token, unscoped = false)
return if token.blank?
- return find_by_encrypted_token(token, unscoped) if fully_encrypted?
+
+ if fully_encrypted?
+ return find_by_encrypted_token(token, unscoped)
+ end
if fallback?
find_by_encrypted_token(token, unscoped) ||
find_by_plaintext_token(token, unscoped)
elsif migrating?
- find_by_plaintext_token(token, unscoped) ||
- find_by_encrypted_token(token, unscoped)
+ find_by_plaintext_token(token, unscoped)
else
- raise ArgumentError, 'Unknown encryption strategy!'
+ raise ArgumentError, 'Unknown encryption phase!'
end
end