summaryrefslogtreecommitdiff
path: root/app/models/concerns/token_authenticatable.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-11-15 16:08:28 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-11-15 16:08:28 +0100
commit3ee8e01923c9452afe9ae21c2135aa8a7eb82f89 (patch)
tree450fed992dbc62d38c2d4c607f40443faacaed89 /app/models/concerns/token_authenticatable.rb
parentf1a74a656bcede06d082e351d6261e43a88a0df7 (diff)
downloadgitlab-ce-3ee8e01923c9452afe9ae21c2135aa8a7eb82f89.tar.gz
Extract token authenticatable strategy fabrication
Diffstat (limited to 'app/models/concerns/token_authenticatable.rb')
-rw-r--r--app/models/concerns/token_authenticatable.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/app/models/concerns/token_authenticatable.rb b/app/models/concerns/token_authenticatable.rb
index f881d119a17..fd8b4d70532 100644
--- a/app/models/concerns/token_authenticatable.rb
+++ b/app/models/concerns/token_authenticatable.rb
@@ -20,13 +20,8 @@ module TokenAuthenticatable
attr_accessor :cleartext_tokens
- strategy = if options[:digest]
- TokenAuthenticatableStrategies::Digest.new(self, token_field, options)
- elsif options[:encrypted]
- TokenAuthenticatableStrategies::Encrypted.new(self, token_field, options)
- else
- TokenAuthenticatableStrategies::Insecure.new(self, token_field, options)
- end
+ strategy = TokenAuthenticatableStrategies::Base
+ .fabricate(self, token_field, options)
if unique
define_singleton_method("find_by_#{token_field}") do |token|