Class: ConcertoCasAuth::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/concerto_cas_auth/engine.rb

Instance Method Summary collapse

Instance Method Details

#plugin_info(plugin_info_class) ⇒ Object

Define plugin information for the Concerto application to read. Do not modify @plugin_info outside of this static configuration block.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/concerto_cas_auth/engine.rb', line 13

def plugin_info(plugin_info_class)
  @plugin_info ||= plugin_info_class.new do

    # Add our concerto_cas_auth route to the main application
    add_route("concerto_cas_auth", ConcertoCasAuth::Engine)

    # View hook to override Devise sign in links in the main application
    add_view_hook "ApplicationController", :signin_hook,
      :partial => "concerto_cas_auth/omniauth_cas/signin"

    # Controller hook to supply a redirect route (example: non public Concerto instances)
    add_controller_hook "ApplicationController", :auth_plugin, :before do
      @auth_url = "/auth/cas"
    end
  end
end