summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-05-14 14:04:04 -0500
committerKamil Trzcinski <ayufan@ayufan.eu>2016-05-14 14:04:04 -0500
commit393459b2b24fe788764ee787552da055846b9a63 (patch)
tree0d14ce47f7ab6b9044199718d71efa911881227b
parent4f1e0014a73e1e310a82a3d8ce52367a1f9d6a9e (diff)
downloadgitlab-ce-393459b2b24fe788764ee787552da055846b9a63.tar.gz
Improve code design after review
-rw-r--r--app/controllers/jwt_controller.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/app/controllers/jwt_controller.rb b/app/controllers/jwt_controller.rb
index e5affb1adc9..0a993bf280e 100644
--- a/app/controllers/jwt_controller.rb
+++ b/app/controllers/jwt_controller.rb
@@ -12,9 +12,8 @@ class JwtController < ApplicationController
head :not_found unless service
result = service.new(@project, @user, auth_params).execute
- return head result[:http_status] if result[:http_status]
- render json: result
+ render json: result, status: result[:http_status]
end
private
@@ -27,10 +26,8 @@ class JwtController < ApplicationController
@user = authenticate_user(login, password)
return if @user
- end
- if ActionController::HttpAuthentication::Basic.has_basic_credentials?(request)
- head :forbidden
+ render_403
end
end