Commit 393459b2 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Improve code design after review

parent 4f1e0014
...@@ -12,9 +12,8 @@ class JwtController < ApplicationController ...@@ -12,9 +12,8 @@ class JwtController < ApplicationController
head :not_found unless service head :not_found unless service
result = service.new(@project, @user, auth_params).execute 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 end
private private
...@@ -27,10 +26,8 @@ class JwtController < ApplicationController ...@@ -27,10 +26,8 @@ class JwtController < ApplicationController
@user = authenticate_user(login, password) @user = authenticate_user(login, password)
return if @user return if @user
end
if ActionController::HttpAuthentication::Basic.has_basic_credentials?(request) render_403
head :forbidden
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment