Last Updated: February 25, 2016
·
624
· synth

How to customize Http Digest Authentication error pages in Ruby on Rails

Full details see: http://p373.net/2013/11/16/how-to-customize-http-digest-authentication-error-pages-in-ruby-on-rails/

module ActionController
  module HttpAuthentication
    module Digest
      def authentication_request_with_customization(controller, realm, message=nil)
        message = controller.render_to_string("public/401.html")
        authentication_request_without_customization(controller, realm, message)
      end
      alias_method_chain :authentication_request, :customization
    end
  end