Module: MerbAuthSlicePassword
- Defined in:
- lib/merb-auth-slice-password.rb
Overview
All Slice code is expected to be namespaced inside a module
Defined Under Namespace
Modules: ExceptionsMixin Classes: Application, Sessions
Class Method Summary collapse
-
.activate ⇒ Object
Activation hook - runs after AfterAppLoads BootLoader.
-
.deactivate ⇒ Object
Deactivation hook - triggered by Merb::Slices.deactivate(MerbAuthSlicePassword).
-
.init ⇒ Object
Initialization hook - runs before AfterAppLoads BootLoader.
-
.loaded ⇒ Object
Stub classes loaded hook - runs before LoadClasses BootLoader right after a slice’s classes have been loaded internally.
-
.setup_router(scope) ⇒ Object
Setup routes inside the host application.
Class Method Details
.activate ⇒ Object
Activation hook - runs after AfterAppLoads BootLoader
45 46 47 |
# File 'lib/merb-auth-slice-password.rb', line 45 def self.activate # Load the default strategies end |
.deactivate ⇒ Object
Deactivation hook - triggered by Merb::Slices.deactivate(MerbAuthSlicePassword)
50 51 |
# File 'lib/merb-auth-slice-password.rb', line 50 def self.deactivate end |
.init ⇒ Object
Initialization hook - runs before AfterAppLoads BootLoader
37 38 39 40 41 42 |
# File 'lib/merb-auth-slice-password.rb', line 37 def self.init require "merb-auth-more/mixins/redirect_back" unless ::Merb::Slices::config[:"merb-auth-slice-password"][:no_default_strategies] ::Merb::Authentication.activate!(:default_password_form) end end |
.loaded ⇒ Object
Stub classes loaded hook - runs before LoadClasses BootLoader right after a slice’s classes have been loaded internally.
33 34 |
# File 'lib/merb-auth-slice-password.rb', line 33 def self.loaded end |
.setup_router(scope) ⇒ Object
prefix your named routes with :mauth_password_slice_ to avoid potential conflicts with global named routes.
Setup routes inside the host application
62 63 64 65 66 67 |
# File 'lib/merb-auth-slice-password.rb', line 62 def self.setup_router(scope) # example of a named route scope.match("/login", :method => :get ).to(:controller => "/exceptions", :action => "unauthenticated").name(:login) scope.match("/login", :method => :put ).to(:controller => "sessions", :action => "update" ).name(:perform_login) scope.match("/logout" ).to(:controller => "sessions", :action => "destroy" ).name(:logout) end |