Sha256: 4f3f97c9a59ac0b185c98f5358ec6f907c97a0c8037408931b5d302f64bf43a8

Contents?: true

Size: 905 Bytes

Versions: 3

Compression:

Stored size: 905 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.  PDS may be screwy. We want to skip logging in 
        # since it's problematic (if anonymous).
        controller.cookies["#{calling_system}_inaccessible".to_sym] = {
          :value => true, :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

3 entries across 3 versions & 1 rubygems

Version Path
authpds-1.1.5 lib/authpds/session/exception_handling.rb
authpds-1.1.4 lib/authpds/session/exception_handling.rb
authpds-1.1.3 lib/authpds/session/exception_handling.rb