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:
authorPatricio Cano <suprnova32@gmail.com>2016-09-27 21:23:51 +0300
committerPatricio Cano <suprnova32@gmail.com>2016-09-27 21:23:51 +0300
commita4944fb7155fc8aa4d1541d9f1e4e80c00f49292 (patch)
tree27672a9cf98fcf1b0475d2eeb808ea4a15d92d8d /lib/gitlab/lfs_token.rb
parent90578f4ad091f80428a661005060af65a0c7151e (diff)
Do not regenerate the `lfs_token` every time `git-lfs-authenticate` is called, instead return the saved token if one is present.
Diffstat (limited to 'lib/gitlab/lfs_token.rb')
-rw-r--r--lib/gitlab/lfs_token.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/gitlab/lfs_token.rb b/lib/gitlab/lfs_token.rb
index d089a2f9b0b..f31444b2b07 100644
--- a/lib/gitlab/lfs_token.rb
+++ b/lib/gitlab/lfs_token.rb
@@ -18,6 +18,8 @@ module Gitlab
end
def generate
+ return value if value
+
token = Devise.friendly_token(TOKEN_LENGTH)
Gitlab::Redis.with do |redis|