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:
Diffstat (limited to 'lib/gitlab/auth.rb')
-rw-r--r--lib/gitlab/auth.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb
index 0970b92723b..3e982168339 100644
--- a/lib/gitlab/auth.rb
+++ b/lib/gitlab/auth.rb
@@ -189,7 +189,7 @@ module Gitlab
user = User.id_in(token.resource_owner_id).first
return unless user && can_user_login_with_non_expired_password?(user)
- Gitlab::Auth::Result.new(user, nil, :oauth, full_authentication_abilities)
+ Gitlab::Auth::Result.new(user, nil, :oauth, abilities_for_scopes(token.scopes))
end
end
end
@@ -230,7 +230,7 @@ module Gitlab
# rubocop: enable CodeReuse/ActiveRecord
def valid_oauth_token?(token)
- token && token.accessible? && valid_scoped_token?(token, [:api])
+ token && token.accessible? && valid_scoped_token?(token, Doorkeeper.configuration.scopes)
end
def valid_scoped_token?(token, scopes)