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
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-03 08:26:40 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-03 08:26:40 +0300
commit368e9a0862dd7d58b009956e8f1ac51d2a549cda (patch)
treedd147a990a2f73988460e2c75b3999d49f156eaf /lib
parentda884aabc7674c68eee23699efb357bc94aef8d3 (diff)
Rubocop: Style/CaseIndentation enabled
Diffstat (limited to 'lib')
-rw-r--r--lib/api/api_guard.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/api/api_guard.rb b/lib/api/api_guard.rb
index cb20bf0720d..b9994fcefda 100644
--- a/lib/api/api_guard.rb
+++ b/lib/api/api_guard.rb
@@ -47,16 +47,12 @@ module APIGuard
case validate_access_token(access_token, scopes)
when Oauth2::AccessTokenValidationService::INSUFFICIENT_SCOPE
raise InsufficientScopeError.new(scopes)
-
when Oauth2::AccessTokenValidationService::EXPIRED
raise ExpiredError
-
when Oauth2::AccessTokenValidationService::REVOKED
raise RevokedError
-
when Oauth2::AccessTokenValidationService::VALID
@current_user = User.find(access_token.resource_owner_id)
-
end
end
end
@@ -121,7 +117,8 @@ module APIGuard
def oauth2_bearer_token_error_handler
Proc.new do |e|
- response = case e
+ response =
+ case e
when MissingTokenError
Rack::OAuth2::Server::Resource::Bearer::Unauthorized.new