summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-07-25 01:51:06 -0700
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-07-25 01:51:06 -0700
commit92d98f5a0c28bffd7b070cda190b07ab72667d58 (patch)
tree5b47d08e34ab57adde1d3a4647791d095513acd3
parent60d3e94874964a626f105d3598e1c122addcf43e (diff)
parenta2d244ec062f3348f6cd1c5218c6097402c5f562 (diff)
downloadgitlab-ce-92d98f5a0c28bffd7b070cda190b07ab72667d58.tar.gz
Merge pull request #1118 from patthoyts/pt/ldap-missing-password
Handle LDAP missing credentials error with a flash message.
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock4
-rw-r--r--app/controllers/omniauth_callbacks_controller.rb11
3 files changed, 7 insertions, 10 deletions
diff --git a/Gemfile b/Gemfile
index 76dc1856424..aa7cfad2934 100644
--- a/Gemfile
+++ b/Gemfile
@@ -13,7 +13,7 @@ gem "devise", "~> 2.1.0"
gem "grit", :git => "https://github.com/gitlabhq/grit.git", :ref => "7f35cb98ff17d534a07e3ce6ec3d580f67402837"
gem "gitolite", :git => "https://github.com/gitlabhq/gitolite-client.git", :ref => "9b715ca8bab6529f6c92204a25f84d12f25a6eb0"
gem "pygments.rb", :git => "https://github.com/gitlabhq/pygments.rb.git", :ref => "2cada028da5054616634a1d9ca6941b65b3ce188"
-gem "omniauth-ldap", :git => "https://github.com/gitlabhq/omniauth-ldap.git", :ref => "7edf27d0281e09561838122982c16b7e62181f44"
+gem "omniauth-ldap", :git => "https://github.com/gitlabhq/omniauth-ldap.git", :ref => "f038dd852d7bd473a557e385d5d7c2fd5dc1dc2e"
gem 'yaml_db', :git => "https://github.com/gitlabhq/yaml_db.git"
gem 'grack', :git => "https://github.com/gitlabhq/grack.git"
gem "linguist", "~> 1.0.0", :git => "https://github.com/gitlabhq/linguist.git"
diff --git a/Gemfile.lock b/Gemfile.lock
index e4c06fed229..9c8ecdd456d 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -42,8 +42,8 @@ GIT
GIT
remote: https://github.com/gitlabhq/omniauth-ldap.git
- revision: 7edf27d0281e09561838122982c16b7e62181f44
- ref: 7edf27d0281e09561838122982c16b7e62181f44
+ revision: f038dd852d7bd473a557e385d5d7c2fd5dc1dc2e
+ ref: f038dd852d7bd473a557e385d5d7c2fd5dc1dc2e
specs:
omniauth-ldap (1.0.2)
net-ldap (~> 0.2.2)
diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb
index fb759c371c4..d19931e93d7 100644
--- a/app/controllers/omniauth_callbacks_controller.rb
+++ b/app/controllers/omniauth_callbacks_controller.rb
@@ -3,13 +3,10 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
# Extend the standard message generation to accept our custom exception
def failure_message
exception = env["omniauth.error"]
- if exception.class == OmniAuth::Error
- error = exception.message
- else
- error = exception.error_reason if exception.respond_to?(:error_reason)
- error ||= exception.error if exception.respond_to?(:error)
- error ||= env["omniauth.error.type"].to_s
- end
+ error = exception.error_reason if exception.respond_to?(:error_reason)
+ error ||= exception.error if exception.respond_to?(:error)
+ error ||= exception.message if exception.respond_to?(:message)
+ error ||= env["omniauth.error.type"].to_s
error.to_s.humanize if error
end