diff options
Diffstat (limited to 'lib/api/api_guard.rb')
-rw-r--r-- | lib/api/api_guard.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/api_guard.rb b/lib/api/api_guard.rb index d1535c43808..0769e464d26 100644 --- a/lib/api/api_guard.rb +++ b/lib/api/api_guard.rb @@ -44,7 +44,7 @@ module API # Helper Methods for Grape Endpoint module HelperMethods prepend_if_ee('EE::API::APIGuard::HelperMethods') # rubocop: disable Cop/InjectEnterpriseEditionModule - include Gitlab::Auth::UserAuthFinders + include Gitlab::Auth::AuthFinders def find_current_user! user = find_user_from_sources @@ -56,7 +56,9 @@ module API # Set admin mode for API requests (if admin) if Feature.enabled?(:user_mode_in_session) - Gitlab::Auth::CurrentUserMode.new(user).enable_admin_mode!(skip_password_validation: true) + current_user_mode = Gitlab::Auth::CurrentUserMode.new(user) + + current_user_mode.enable_sessionless_admin_mode! end user |