Sha256: 492f08ebdb6517952f82bf24331a1e5eb4d92b00a01a0f128c791d6176e96890

Contents?: true

Size: 917 Bytes

Versions: 16

Compression:

Stored size: 917 Bytes

Contents

# the mixin to provide the exceptions controller action for Unauthenticated
module MerbAuthSliceMultisite::ExceptionsMixin
  def unauthenticated
    provides :xml, :js, :json, :yaml

    case content_type
    when :html
      render
    else
      basic_authentication.request!
      ""
    end
  end # unauthenticated
end

Merb::Authentication.customize_default do
  
  Exceptions.class_eval do
    include Merb::Slices::Support # Required to provide slice_url
  
    # # This stuff allows us to provide a default view
    the_view_path = File.expand_path(File.dirname(__FILE__) / ".." / "views")
    self._template_roots ||= []
    self._template_roots << [the_view_path, :_template_location]
    self._template_roots << [Merb.dir_for(:view), :_template_location]
    
    include MerbAuthSliceMultisite::ExceptionsMixin
    
    show_action :unauthenticated

  end# Exceptions.class_eval
  
end # Customize default

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
scottmotte-merb_auth_slice_multisite-0.6.0 app/controllers/exceptions.rb
scottmotte-merb_auth_slice_multisite-0.6.1 app/controllers/exceptions.rb
scottmotte-merb_auth_slice_multisite-0.6.2 app/controllers/exceptions.rb
scottmotte-merb_auth_slice_multisite-0.7.0 app/controllers/exceptions.rb
scottmotte-merb_auth_slice_multisite-0.7.1 app/controllers/exceptions.rb
scottmotte-merb_auth_slice_multisite-0.7.2 app/controllers/exceptions.rb
scottmotte-merb_auth_slice_multisite-0.7.3 app/controllers/exceptions.rb
scottmotte-merb_auth_slice_multisite-0.7.4 app/controllers/exceptions.rb
scottmotte-merb_auth_slice_multisite-0.7.5 app/controllers/exceptions.rb
scottmotte-merb_auth_slice_multisite-0.8.0 app/controllers/exceptions.rb
scottmotte-merb_auth_slice_multisite-0.8.1 app/controllers/exceptions.rb
scottmotte-merb_auth_slice_multisite-0.8.3 app/controllers/exceptions.rb
scottmotte-merb_auth_slice_multisite-0.8.4 app/controllers/exceptions.rb
scottmotte-merb_auth_slice_multisite-0.8.5 app/controllers/exceptions.rb
scottmotte-merb_auth_slice_multisite-0.8.6 app/controllers/exceptions.rb
merb_auth_slice_multisite-0.8.6 app/controllers/exceptions.rb