Module: Immunio::Authentication
- Included in:
- Immunio
- Defined in:
- lib/immunio/authentication.rb
Overview
API for triggering the Immunio authentication hooks.
Instance Method Summary collapse
-
#failed_login(options_ro = {}) ⇒ Object
Call after an unsuccessful login.
-
#failed_password_reset(options_ro = {}) ⇒ Object
Call after a failed password reset has been requested.
-
#login(options_ro = {}) ⇒ Object
Call after a successful login.
-
#logout(options_ro = {}) ⇒ Object
Call after a user logs out.
-
#password_reset(options_ro = {}) ⇒ Object
Call after a successful password reset has been requested for a user.
-
#set_user(options_ro = {}) ⇒ Object
Call after the current user is changed.
Instance Method Details
#failed_login(options_ro = {}) ⇒ Object
Call after an unsuccessful login.
22 23 24 25 26 |
# File 'lib/immunio/authentication.rb', line 22 def failed_login(={}) plugin, = parse_opts() return unless plugin Immunio.run_hook! plugin, "authenticate", .merge({is_valid: false}) end |
#failed_password_reset(options_ro = {}) ⇒ Object
Call after a failed password reset has been requested.
51 52 53 54 55 56 |
# File 'lib/immunio/authentication.rb', line 51 def failed_password_reset(={}) plugin, = parse_opts() return unless plugin [:is_valid] = false Immunio.run_hook! plugin, "framework_password_reset", end |
#login(options_ro = {}) ⇒ Object
Call after a successful login.
14 15 16 17 18 19 |
# File 'lib/immunio/authentication.rb', line 14 def login(={}) plugin, = parse_opts() return unless plugin Immunio.run_hook! plugin, "authenticate", .merge({is_valid: true}) Immunio.run_hook! plugin, "framework_login", end |
#logout(options_ro = {}) ⇒ Object
Call after a user logs out.
29 30 31 32 33 |
# File 'lib/immunio/authentication.rb', line 29 def logout(={}) plugin, = parse_opts() return unless plugin Immunio.run_hook! plugin, "framework_logout", end |
#password_reset(options_ro = {}) ⇒ Object
Call after a successful password reset has been requested for a user.
43 44 45 46 47 48 |
# File 'lib/immunio/authentication.rb', line 43 def password_reset(={}) plugin, = parse_opts() return unless plugin [:is_valid] = true Immunio.run_hook! plugin, "framework_password_reset", end |