diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-08-17 11:56:50 -0500 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-08-18 16:47:26 -0500 |
commit | c29780086201b331091be3ba5df0653381cf0c2c (patch) | |
tree | 06d8ad068c2761905e3bf57bc649d956aa0cd9e9 /config/initializers | |
parent | ff6f0ada3fc4c4dc89c9f2f0d947099c2d14ae88 (diff) | |
download | gitlab-ce-c29780086201b331091be3ba5df0653381cf0c2c.tar.gz |
Removed unnecessary service for user retrieval and improved API error message.
Diffstat (limited to 'config/initializers')
-rw-r--r-- | config/initializers/doorkeeper.rb | 3 |
1 files changed, 2 insertions, 1 deletions
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. |