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


236
237
238
239
240
241
242
243
# File 'lib/api/api_guard.rb', line 236

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