summaryrefslogtreecommitdiff
path: root/lib/gitlab/auth.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/auth.rb')
-rw-r--r--lib/gitlab/auth.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb
index 2879a4d2f5d..8dda65c71ef 100644
--- a/lib/gitlab/auth.rb
+++ b/lib/gitlab/auth.rb
@@ -111,14 +111,14 @@ module Gitlab
end
def valid_oauth_token?(token)
- token && token.accessible? && token_has_scope?(token)
+ token && token.accessible? && valid_api_token?(token)
end
def valid_personal_access_token?(token, user)
- token && token.user == user && token_has_scope?(token)
+ token && token.user == user && valid_api_token?(token)
end
- def token_has_scope?(token)
+ def valid_api_token?(token)
AccessTokenValidationService.new(token).include_any_scope?(['api'])
end