Module: Janus::Hooks::ClassMethods
- Defined in:
- lib/janus/hooks.rb
Overview
Instance Method Summary collapse
-
#after_authenticate(&block) ⇒ Object
Executed after a strategy succeeds to authenticate a user.
-
#after_fetch(&block) ⇒ Object
Executed the first time an authenticated user is fetched from session.
-
#after_login(&block) ⇒ Object
Executed after a user is logged in.
-
#after_logout(&block) ⇒ Object
Executed after a user is logged out.
-
#run_callbacks(kind, *args) ⇒ Object
:nodoc:.
Instance Method Details
#after_authenticate(&block) ⇒ Object
Executed after a strategy succeeds to authenticate a user.
23 24 25 |
# File 'lib/janus/hooks.rb', line 23 def after_authenticate(&block) add_callback(:authenticate, block) end |
#after_fetch(&block) ⇒ Object
Executed the first time an authenticated user is fetched from session.
28 29 30 |
# File 'lib/janus/hooks.rb', line 28 def after_fetch(&block) add_callback(:fetch, block) end |
#after_login(&block) ⇒ Object
Executed after a user is logged in.
33 34 35 |
# File 'lib/janus/hooks.rb', line 33 def after_login(&block) add_callback(:login, block) end |
#after_logout(&block) ⇒ Object
Executed after a user is logged out. after_logout will be executed for each scope when logging out from multiple scopes at once.
39 40 41 |
# File 'lib/janus/hooks.rb', line 39 def after_logout(&block) add_callback(:logout, block) end |
#run_callbacks(kind, *args) ⇒ Object
:nodoc:
43 44 45 |
# File 'lib/janus/hooks.rb', line 43 def run_callbacks(kind, *args) # :nodoc: callbacks(kind).each { |block| block.call(*args) } end |