Sha256: 5761f42126de4c1134b6362a493eb4e9d3301d3aae79e9253bacfba04543f57c

Contents?: true

Size: 931 Bytes

Versions: 9

Compression:

Stored size: 931 Bytes

Contents

module Authpds
  module Session
    module ExceptionHandling
      def handle_login_exception(error)
        # Set a cookie saying that we've got some invalid stuff going on
        # in this session.  Either PDS is screwy, OpenSSO is screwy, or both.
        # Either way, we want to skip logging in since it's problematic (if anonymous).
        controller.cookies["#{calling_system}_inaccessible".to_sym] = {
          :value => session_id,
          :path => "/" } if anonymous?
        # If anonymous access isn't allowed, we can't rightfully set the cookie.
        # We probably should send to a system down page.
        controller.redirect_to(login_inaccessible_url)
        alert_the_authorities error
      end

      def alert_the_authorities(error)
        controller.logger.error("Error in #{self.class}. Something is amiss with PDS authentication.\n#{error}\n#{error.backtrace.inspect}}")
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
authpds-0.2.9 lib/authpds/session/exception_handling.rb
authpds-0.2.8 lib/authpds/session/exception_handling.rb
authpds-0.2.7 lib/authpds/session/exception_handling.rb
authpds-0.2.6 lib/authpds/session/exception_handling.rb
authpds-0.2.5 lib/authpds/session/exception_handling.rb
authpds-0.2.4 lib/authpds/session/exception_handling.rb
authpds-0.2.3 lib/authpds/session/exception_handling.rb
authpds-0.2.2 lib/authpds/session/exception_handling.rb
authpds-0.2.1 lib/authpds/session/exception_handling.rb