From c29780086201b331091be3ba5df0653381cf0c2c Mon Sep 17 00:00:00 2001 From: Patricio Cano Date: Wed, 17 Aug 2016 11:56:50 -0500 Subject: Removed unnecessary service for user retrieval and improved API error message. --- config/initializers/doorkeeper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/initializers/doorkeeper.rb b/config/initializers/doorkeeper.rb index f78f0cf7c5c..6d08714dcf7 100644 --- a/config/initializers/doorkeeper.rb +++ b/config/initializers/doorkeeper.rb @@ -12,7 +12,8 @@ Doorkeeper.configure do end resource_owner_from_credentials do |routes| - UserRetrievalService.new(params[:username], params[:password]).execute + user = Gitlab::Auth.find_with_user_password(params[:username], params[:password]) + user unless user && user.two_factor_enabled? end # If you want to restrict access to the web interface for adding oauth authorized applications, you need to declare the block below. -- cgit v1.2.1