Class: API::APIGuard::AdminModeMiddleware

Inherits:
Grape::Middleware::Base
  • Object
show all
Defined in:
lib/api/api_guard.rb

Instance Method Summary collapse

Instance Method Details

#afterObject



242
243
244
245
246
247
248
249
# File 'lib/api/api_guard.rb', line 242

def after
  # Use a Grape middleware since the Grape `after` blocks might run
  # before we are finished rendering the `Grape::Entity` classes
  Gitlab::Auth::CurrentUserMode.reset_bypass_session! if Gitlab::CurrentSettings.admin_mode

  # Explicit nil is needed or the api call return value will be overwritten
  nil
end