diff options
author | Valery Sizov <vsv2711@gmail.com> | 2014-11-27 14:34:39 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2014-12-04 14:03:55 +0300 |
commit | 3a5ed5260b24051939575d1934ce9b8392cac09f (patch) | |
tree | 04d361e52d16234f00e5cdd27b5ebfef9a503579 /app/controllers/omniauth_callbacks_controller.rb | |
parent | 1a80d13a3990937580c97e2b0ba8fb98f69bc055 (diff) |
Supporting for multiple omniauth provider for the same user
Diffstat (limited to 'app/controllers/omniauth_callbacks_controller.rb')
-rw-r--r-- | app/controllers/omniauth_callbacks_controller.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index 58d0506c07d..3e984e5007a 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -51,7 +51,6 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController # Only allow properly saved users to login. if @user.persisted? && @user.valid? - # binding.pry sign_in_and_redirect(@user.gl_user) else error_message = @@ -66,8 +65,8 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController redirect_to omniauth_error_path(oauth['provider'], error: error_message) and return end end - rescue StandardError - flash[:notice] = "There's no such user!" + rescue ForbiddenAction => e + flash[:notice] = e.message redirect_to new_user_session_path end |