Module: Devise::Models::CastleProtectable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/castle_devise/models/castle_protectable.rb
Overview
This module contains methods that will be included in your Devise model when you include the castle_protectable Devise module.
Configuration:
castle_hooks: configures which events trigger Castle API calls
{
after_login: true, # trigger risk($login) and log($login, $failed),
before_registration: true, # trigger filter($registration)
after_password_reset_request: true, # trigger log($password_reset_request, $succeeded)
# and log($password_reset_request, $failed)
profile_update: true # trigger risk($profile_update, $attempted),
# log($profile_update, $succeeded)
# and log($profile_update, $failed)
}
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#castle_id ⇒ String?
ID used for sending requests to Castle.
-
#castle_name ⇒ String?
This method is meant to be overridden with a human-readable username that will be shown on the Castle Dashboard.
-
#castle_traits ⇒ Hash
Additional traits that will be sent to Castle.
Instance Method Details
#castle_id ⇒ String?
Returns ID used for sending requests to Castle.
28 29 30 |
# File 'lib/castle_devise/models/castle_protectable.rb', line 28 def castle_id id&.to_s end |
#castle_name ⇒ String?
This method is meant to be overridden with a human-readable username that will be shown on the Castle Dashboard.
74 75 76 |
# File 'lib/castle_devise/models/castle_protectable.rb', line 74 def castle_name nil end |
#castle_traits ⇒ Hash
Returns additional traits that will be sent to Castle.
52 53 54 |
# File 'lib/castle_devise/models/castle_protectable.rb', line 52 def castle_traits {} end |