diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-08-27 17:01:11 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-08-31 15:10:01 +0300 |
commit | 6f785d584b2607ccd6997933364434e7d9a27504 (patch) | |
tree | 805686987d06de3a9dc6a862a5dff725b76ccdd6 /config | |
parent | abb5b9f6e526195c4eb027d5b7c28e070d9ac3c1 (diff) |
retrieving oauth token with LDAP credentials
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/doorkeeper.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/config/initializers/doorkeeper.rb b/config/initializers/doorkeeper.rb index 6139ddbe6cd..66ac88e9f4a 100644 --- a/config/initializers/doorkeeper.rb +++ b/config/initializers/doorkeeper.rb @@ -12,8 +12,7 @@ Doorkeeper.configure do end resource_owner_from_credentials do |routes| - u = User.find_by(email: params[:username]) || User.find_by(username: params[:username]) - u if u && u.valid_password?(params[:password]) + Gitlab::Auth.new.find(params[:username], params[:password]) end # If you want to restrict access to the web interface for adding oauth authorized applications, you need to declare the block below. |