app/controllers/open_sesame/sessions_controller.rb in opensesame-0.1.2 vs app/controllers/open_sesame/sessions_controller.rb in opensesame-0.2.0

- old
+ new

@@ -5,12 +5,12 @@ skip_authorization_check if defined?(CanCan) before_filter :attempt_auto_authenticate, :only => :new after_filter :clear_auto_attempt!, :only => :create def new - if warden.message - flash.now[:notice] = warden.message + if error_message + flash.now[:notice] = error_message end render :layout => 'open_sesame/application' end def create @@ -26,9 +26,13 @@ def failure raise params.inspect end protected + + def error_message + warden.message || env['omniauth.error'] || env['omniauth.error.type'] + end def attempt_auto_authenticate return unless attempt_auto_access? redirect_to identity_request_path(OpenSesame.auto_access_provider)