summaryrefslogtreecommitdiff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-05-11 10:16:23 +0530
committerTimothy Andrew <mail@timothyandrew.net>2016-05-11 10:16:23 +0530
commitd915e7d5cad99b8971e65d30accc8bc7a05fecbc (patch)
tree0583e9d36fb2d38101737d0a891ac29b7d87c373 /app/controllers/application_controller.rb
parent2e9742997ddbfaeff350eb5334b7f641a779550c (diff)
downloadgitlab-ce-d915e7d5cad99b8971e65d30accc8bc7a05fecbc.tar.gz
Reuse the private token param and header for personal access tokens.
- https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3749#note_11626427 - Personal access tokens are still a separate entity as far as the codebase is concerned - they just happen to use the same entry point as private tokens. - Update tests and documentation to reflect this change
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 72ba1a85cff..b26afb42e74 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -80,7 +80,7 @@ class ApplicationController < ActionController::Base
end
def authenticate_user_from_personal_access_token!
- token_string = params[:personal_access_token].presence || request.headers['PERSONAL_ACCESS_TOKEN'].presence
+ token_string = params[:private_token].presence || request.headers['PRIVATE-TOKEN'].presence
personal_access_token = PersonalAccessToken.active.find_by_token(token_string)
user = personal_access_token && personal_access_token.user