Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJob van der Voort <jobvandervoort@gmail.com>2015-04-21 17:21:51 +0300
committerJob van der Voort <jobvandervoort@gmail.com>2015-04-21 17:21:51 +0300
commita8e93b7f51d968c1380ed210499869b62b07fd15 (patch)
treec864e80dfd9cf4f83fcede678acc986e3a125bf5 /app/models/concerns/token_authenticatable.rb
parent0625b15a481b3a3edd88110b3c18031ad9068d2f (diff)
Version 7.10.0.rc5v7.10.0.rc5
Diffstat (limited to 'app/models/concerns/token_authenticatable.rb')
-rw-r--r--app/models/concerns/token_authenticatable.rb31
1 files changed, 0 insertions, 31 deletions
diff --git a/app/models/concerns/token_authenticatable.rb b/app/models/concerns/token_authenticatable.rb
deleted file mode 100644
index 9b88ec1cc38..00000000000
--- a/app/models/concerns/token_authenticatable.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-module TokenAuthenticatable
- extend ActiveSupport::Concern
-
- module ClassMethods
- def find_by_authentication_token(authentication_token = nil)
- if authentication_token
- where(authentication_token: authentication_token).first
- end
- end
- end
-
- def ensure_authentication_token
- if authentication_token.blank?
- self.authentication_token = generate_authentication_token
- end
- end
-
- def reset_authentication_token!
- self.authentication_token = generate_authentication_token
- save
- end
-
- private
-
- def generate_authentication_token
- loop do
- token = Devise.friendly_token
- break token unless self.class.unscoped.where(authentication_token: token).first
- end
- end
-end