summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-05-15 08:52:26 -0500
committerKamil Trzcinski <ayufan@ayufan.eu>2016-05-15 08:52:26 -0500
commitdfd0e2450aabc3b5c322c4a4382edb84caa7101b (patch)
tree3b14309a4303c35272fed021446fd2ddee479e91 /app/services
parent7b88dca77eeb2a93b5a343d27af513ea28222379 (diff)
downloadgitlab-ce-dfd0e2450aabc3b5c322c4a4382edb84caa7101b.tar.gz
Improve authentication service specs
Diffstat (limited to 'app/services')
-rw-r--r--app/services/auth/container_registry_authentication_service.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/services/auth/container_registry_authentication_service.rb b/app/services/auth/container_registry_authentication_service.rb
index bbbc84475c8..c61d339ffdd 100644
--- a/app/services/auth/container_registry_authentication_service.rb
+++ b/app/services/auth/container_registry_authentication_service.rb
@@ -7,10 +7,10 @@ module Auth
if params[:offline_token]
return error('forbidden', 403) unless current_user
+ else
+ return error('forbidden', 401) unless scope
end
- return error('forbidden', 401) unless scope
-
{ token: authorized_token(scope).encoded }
end
@@ -21,7 +21,7 @@ module Auth
token.issuer = registry.issuer
token.audience = params[:service]
token.subject = current_user.try(:username)
- token[:access] = accesses
+ token[:access] = accesses.compact
token
end