Class: Searls::Auth::Config
- Inherits:
-
Struct
- Object
- Struct
- Searls::Auth::Config
- Defined in:
- lib/searls/auth/config.rb
Instance Attribute Summary collapse
-
#after_login_success ⇒ Object
Returns the value of attribute after_login_success.
-
#app_name ⇒ Object
Returns the value of attribute app_name.
-
#app_url ⇒ Object
Returns the value of attribute app_url.
-
#auth_methods ⇒ Object
Returns the value of attribute auth_methods.
-
#auto_login_after_password_reset ⇒ Object
Returns the value of attribute auto_login_after_password_reset.
-
#before_password_reset ⇒ Object
Returns the value of attribute before_password_reset.
-
#email_background_color ⇒ Object
Returns the value of attribute email_background_color.
-
#email_banner_image_path ⇒ Object
Returns the value of attribute email_banner_image_path.
-
#email_button_color ⇒ Object
Returns the value of attribute email_button_color.
-
#email_otp_expiry_minutes ⇒ Object
Returns the value of attribute email_otp_expiry_minutes.
-
#email_verification_mode ⇒ Object
Returns the value of attribute email_verification_mode.
-
#email_verified_predicate ⇒ Object
Returns the value of attribute email_verified_predicate.
-
#email_verified_setter ⇒ Object
Returns the value of attribute email_verified_setter.
-
#flash_error_after_login_attempt_invalid_password ⇒ Object
Returns the value of attribute flash_error_after_login_attempt_invalid_password.
-
#flash_error_after_login_attempt_unknown_email ⇒ Object
Returns the value of attribute flash_error_after_login_attempt_unknown_email.
-
#flash_error_after_login_attempt_unverified_email ⇒ Object
Returns the value of attribute flash_error_after_login_attempt_unverified_email.
-
#flash_error_after_password_misconfigured ⇒ Object
Returns the value of attribute flash_error_after_password_misconfigured.
-
#flash_error_after_password_reset_not_enabled ⇒ Object
Returns the value of attribute flash_error_after_password_reset_not_enabled.
-
#flash_error_after_password_reset_password_blank ⇒ Object
Returns the value of attribute flash_error_after_password_reset_password_blank.
-
#flash_error_after_password_reset_password_mismatch ⇒ Object
Returns the value of attribute flash_error_after_password_reset_password_mismatch.
-
#flash_error_after_password_reset_token_invalid ⇒ Object
Returns the value of attribute flash_error_after_password_reset_token_invalid.
-
#flash_error_after_register_attempt ⇒ Object
Returns the value of attribute flash_error_after_register_attempt.
-
#flash_error_after_settings_current_password_invalid ⇒ Object
Returns the value of attribute flash_error_after_settings_current_password_invalid.
-
#flash_error_after_settings_current_password_missing ⇒ Object
Returns the value of attribute flash_error_after_settings_current_password_missing.
-
#flash_error_after_verify_attempt_exceeds_limit ⇒ Object
Returns the value of attribute flash_error_after_verify_attempt_exceeds_limit.
-
#flash_error_after_verify_attempt_incorrect_email_otp ⇒ Object
Returns the value of attribute flash_error_after_verify_attempt_incorrect_email_otp.
-
#flash_error_after_verify_attempt_invalid_link ⇒ Object
Returns the value of attribute flash_error_after_verify_attempt_invalid_link.
-
#flash_notice_after_email_verified ⇒ Object
Returns the value of attribute flash_notice_after_email_verified.
-
#flash_notice_after_login ⇒ Object
Returns the value of attribute flash_notice_after_login.
-
#flash_notice_after_login_attempt ⇒ Object
Returns the value of attribute flash_notice_after_login_attempt.
-
#flash_notice_after_login_with_unverified_email ⇒ Object
Returns the value of attribute flash_notice_after_login_with_unverified_email.
-
#flash_notice_after_logout ⇒ Object
Returns the value of attribute flash_notice_after_logout.
-
#flash_notice_after_password_reset ⇒ Object
Returns the value of attribute flash_notice_after_password_reset.
-
#flash_notice_after_password_reset_email ⇒ Object
Returns the value of attribute flash_notice_after_password_reset_email.
-
#flash_notice_after_registration ⇒ Object
Returns the value of attribute flash_notice_after_registration.
-
#flash_notice_after_settings_update ⇒ Object
Returns the value of attribute flash_notice_after_settings_update.
-
#flash_notice_after_verification_email_resent ⇒ Object
Returns the value of attribute flash_notice_after_verification_email_resent.
-
#layout ⇒ Object
Returns the value of attribute layout.
-
#login_view ⇒ Object
Returns the value of attribute login_view.
-
#mail_email_verification_template_name ⇒ Object
Returns the value of attribute mail_email_verification_template_name.
-
#mail_email_verification_template_path ⇒ Object
Returns the value of attribute mail_email_verification_template_path.
-
#mail_layout ⇒ Object
Returns the value of attribute mail_layout.
-
#mail_login_template_name ⇒ Object
Returns the value of attribute mail_login_template_name.
-
#mail_login_template_path ⇒ Object
Returns the value of attribute mail_login_template_path.
-
#mail_password_reset_template_name ⇒ Object
Returns the value of attribute mail_password_reset_template_name.
-
#mail_password_reset_template_path ⇒ Object
Returns the value of attribute mail_password_reset_template_path.
-
#max_allowed_email_otp_attempts ⇒ Object
Returns the value of attribute max_allowed_email_otp_attempts.
-
#password_present_predicate ⇒ Object
Returns the value of attribute password_present_predicate.
-
#password_reset_edit_view ⇒ Object
Returns the value of attribute password_reset_edit_view.
-
#password_reset_enabled ⇒ Object
Returns the value of attribute password_reset_enabled.
-
#password_reset_request_view ⇒ Object
Returns the value of attribute password_reset_request_view.
-
#password_reset_token_finder ⇒ Object
Returns the value of attribute password_reset_token_finder.
-
#password_reset_token_generator ⇒ Object
Returns the value of attribute password_reset_token_generator.
-
#password_setter ⇒ Object
Returns the value of attribute password_setter.
-
#password_verifier ⇒ Object
Returns the value of attribute password_verifier.
-
#pending_email_verification_view ⇒ Object
Returns the value of attribute pending_email_verification_view.
-
#preserve_session_keys_after_logout ⇒ Object
Returns the value of attribute preserve_session_keys_after_logout.
-
#redirect_path_after_login ⇒ Object
Returns the value of attribute redirect_path_after_login.
-
#redirect_path_after_register ⇒ Object
Returns the value of attribute redirect_path_after_register.
-
#redirect_path_after_settings_change ⇒ Object
Returns the value of attribute redirect_path_after_settings_change.
-
#register_view ⇒ Object
Returns the value of attribute register_view.
-
#token_generator ⇒ Object
Returns the value of attribute token_generator.
-
#user_finder_by_email ⇒ Object
Returns the value of attribute user_finder_by_email.
-
#user_finder_by_id ⇒ Object
Returns the value of attribute user_finder_by_id.
-
#user_finder_by_token ⇒ Object
Returns the value of attribute user_finder_by_token.
-
#user_initializer ⇒ Object
Returns the value of attribute user_initializer.
-
#user_name_method ⇒ Object
Returns the value of attribute user_name_method.
-
#validate_registration ⇒ Object
Returns the value of attribute validate_registration.
-
#verify_view ⇒ Object
Returns the value of attribute verify_view.
Instance Method Summary collapse
- #password_present?(user) ⇒ Boolean
- #password_reset_enabled? ⇒ Boolean
-
#resolve(option, *args) ⇒ Object
Get values from values that might be procs.
- #validate! ⇒ Object
Instance Attribute Details
#after_login_success ⇒ Object
Returns the value of attribute after_login_success
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def after_login_success @after_login_success end |
#app_name ⇒ Object
Returns the value of attribute app_name
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def app_name @app_name end |
#app_url ⇒ Object
Returns the value of attribute app_url
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def app_url @app_url end |
#auth_methods ⇒ Object
Returns the value of attribute auth_methods
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def auth_methods @auth_methods end |
#auto_login_after_password_reset ⇒ Object
Returns the value of attribute auto_login_after_password_reset
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def auto_login_after_password_reset @auto_login_after_password_reset end |
#before_password_reset ⇒ Object
Returns the value of attribute before_password_reset
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def before_password_reset @before_password_reset end |
#email_background_color ⇒ Object
Returns the value of attribute email_background_color
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def email_background_color @email_background_color end |
#email_banner_image_path ⇒ Object
Returns the value of attribute email_banner_image_path
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def @email_banner_image_path end |
#email_button_color ⇒ Object
Returns the value of attribute email_button_color
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def @email_button_color end |
#email_otp_expiry_minutes ⇒ Object
Returns the value of attribute email_otp_expiry_minutes
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def email_otp_expiry_minutes @email_otp_expiry_minutes end |
#email_verification_mode ⇒ Object
Returns the value of attribute email_verification_mode
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def email_verification_mode @email_verification_mode end |
#email_verified_predicate ⇒ Object
Returns the value of attribute email_verified_predicate
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def email_verified_predicate @email_verified_predicate end |
#email_verified_setter ⇒ Object
Returns the value of attribute email_verified_setter
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def email_verified_setter @email_verified_setter end |
#flash_error_after_login_attempt_invalid_password ⇒ Object
Returns the value of attribute flash_error_after_login_attempt_invalid_password
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_error_after_login_attempt_invalid_password @flash_error_after_login_attempt_invalid_password end |
#flash_error_after_login_attempt_unknown_email ⇒ Object
Returns the value of attribute flash_error_after_login_attempt_unknown_email
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_error_after_login_attempt_unknown_email @flash_error_after_login_attempt_unknown_email end |
#flash_error_after_login_attempt_unverified_email ⇒ Object
Returns the value of attribute flash_error_after_login_attempt_unverified_email
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_error_after_login_attempt_unverified_email @flash_error_after_login_attempt_unverified_email end |
#flash_error_after_password_misconfigured ⇒ Object
Returns the value of attribute flash_error_after_password_misconfigured
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_error_after_password_misconfigured @flash_error_after_password_misconfigured end |
#flash_error_after_password_reset_not_enabled ⇒ Object
Returns the value of attribute flash_error_after_password_reset_not_enabled
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_error_after_password_reset_not_enabled @flash_error_after_password_reset_not_enabled end |
#flash_error_after_password_reset_password_blank ⇒ Object
Returns the value of attribute flash_error_after_password_reset_password_blank
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_error_after_password_reset_password_blank @flash_error_after_password_reset_password_blank end |
#flash_error_after_password_reset_password_mismatch ⇒ Object
Returns the value of attribute flash_error_after_password_reset_password_mismatch
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_error_after_password_reset_password_mismatch @flash_error_after_password_reset_password_mismatch end |
#flash_error_after_password_reset_token_invalid ⇒ Object
Returns the value of attribute flash_error_after_password_reset_token_invalid
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_error_after_password_reset_token_invalid @flash_error_after_password_reset_token_invalid end |
#flash_error_after_register_attempt ⇒ Object
Returns the value of attribute flash_error_after_register_attempt
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_error_after_register_attempt @flash_error_after_register_attempt end |
#flash_error_after_settings_current_password_invalid ⇒ Object
Returns the value of attribute flash_error_after_settings_current_password_invalid
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_error_after_settings_current_password_invalid @flash_error_after_settings_current_password_invalid end |
#flash_error_after_settings_current_password_missing ⇒ Object
Returns the value of attribute flash_error_after_settings_current_password_missing
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_error_after_settings_current_password_missing @flash_error_after_settings_current_password_missing end |
#flash_error_after_verify_attempt_exceeds_limit ⇒ Object
Returns the value of attribute flash_error_after_verify_attempt_exceeds_limit
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_error_after_verify_attempt_exceeds_limit @flash_error_after_verify_attempt_exceeds_limit end |
#flash_error_after_verify_attempt_incorrect_email_otp ⇒ Object
Returns the value of attribute flash_error_after_verify_attempt_incorrect_email_otp
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_error_after_verify_attempt_incorrect_email_otp @flash_error_after_verify_attempt_incorrect_email_otp end |
#flash_error_after_verify_attempt_invalid_link ⇒ Object
Returns the value of attribute flash_error_after_verify_attempt_invalid_link
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_error_after_verify_attempt_invalid_link @flash_error_after_verify_attempt_invalid_link end |
#flash_notice_after_email_verified ⇒ Object
Returns the value of attribute flash_notice_after_email_verified
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_notice_after_email_verified @flash_notice_after_email_verified end |
#flash_notice_after_login ⇒ Object
Returns the value of attribute flash_notice_after_login
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_notice_after_login @flash_notice_after_login end |
#flash_notice_after_login_attempt ⇒ Object
Returns the value of attribute flash_notice_after_login_attempt
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_notice_after_login_attempt @flash_notice_after_login_attempt end |
#flash_notice_after_login_with_unverified_email ⇒ Object
Returns the value of attribute flash_notice_after_login_with_unverified_email
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_notice_after_login_with_unverified_email @flash_notice_after_login_with_unverified_email end |
#flash_notice_after_logout ⇒ Object
Returns the value of attribute flash_notice_after_logout
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_notice_after_logout @flash_notice_after_logout end |
#flash_notice_after_password_reset ⇒ Object
Returns the value of attribute flash_notice_after_password_reset
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_notice_after_password_reset @flash_notice_after_password_reset end |
#flash_notice_after_password_reset_email ⇒ Object
Returns the value of attribute flash_notice_after_password_reset_email
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_notice_after_password_reset_email @flash_notice_after_password_reset_email end |
#flash_notice_after_registration ⇒ Object
Returns the value of attribute flash_notice_after_registration
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_notice_after_registration @flash_notice_after_registration end |
#flash_notice_after_settings_update ⇒ Object
Returns the value of attribute flash_notice_after_settings_update
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_notice_after_settings_update @flash_notice_after_settings_update end |
#flash_notice_after_verification_email_resent ⇒ Object
Returns the value of attribute flash_notice_after_verification_email_resent
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def flash_notice_after_verification_email_resent @flash_notice_after_verification_email_resent end |
#layout ⇒ Object
Returns the value of attribute layout
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def layout @layout end |
#login_view ⇒ Object
Returns the value of attribute login_view
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def login_view @login_view end |
#mail_email_verification_template_name ⇒ Object
Returns the value of attribute mail_email_verification_template_name
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def mail_email_verification_template_name @mail_email_verification_template_name end |
#mail_email_verification_template_path ⇒ Object
Returns the value of attribute mail_email_verification_template_path
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def mail_email_verification_template_path @mail_email_verification_template_path end |
#mail_layout ⇒ Object
Returns the value of attribute mail_layout
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def mail_layout @mail_layout end |
#mail_login_template_name ⇒ Object
Returns the value of attribute mail_login_template_name
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def mail_login_template_name @mail_login_template_name end |
#mail_login_template_path ⇒ Object
Returns the value of attribute mail_login_template_path
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def mail_login_template_path @mail_login_template_path end |
#mail_password_reset_template_name ⇒ Object
Returns the value of attribute mail_password_reset_template_name
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def mail_password_reset_template_name @mail_password_reset_template_name end |
#mail_password_reset_template_path ⇒ Object
Returns the value of attribute mail_password_reset_template_path
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def mail_password_reset_template_path @mail_password_reset_template_path end |
#max_allowed_email_otp_attempts ⇒ Object
Returns the value of attribute max_allowed_email_otp_attempts
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def max_allowed_email_otp_attempts @max_allowed_email_otp_attempts end |
#password_present_predicate ⇒ Object
Returns the value of attribute password_present_predicate
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def password_present_predicate @password_present_predicate end |
#password_reset_edit_view ⇒ Object
Returns the value of attribute password_reset_edit_view
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def password_reset_edit_view @password_reset_edit_view end |
#password_reset_enabled ⇒ Object
Returns the value of attribute password_reset_enabled
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def password_reset_enabled @password_reset_enabled end |
#password_reset_request_view ⇒ Object
Returns the value of attribute password_reset_request_view
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def password_reset_request_view @password_reset_request_view end |
#password_reset_token_finder ⇒ Object
Returns the value of attribute password_reset_token_finder
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def password_reset_token_finder @password_reset_token_finder end |
#password_reset_token_generator ⇒ Object
Returns the value of attribute password_reset_token_generator
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def password_reset_token_generator @password_reset_token_generator end |
#password_setter ⇒ Object
Returns the value of attribute password_setter
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def password_setter @password_setter end |
#password_verifier ⇒ Object
Returns the value of attribute password_verifier
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def password_verifier @password_verifier end |
#pending_email_verification_view ⇒ Object
Returns the value of attribute pending_email_verification_view
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def pending_email_verification_view @pending_email_verification_view end |
#preserve_session_keys_after_logout ⇒ Object
Returns the value of attribute preserve_session_keys_after_logout
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def preserve_session_keys_after_logout @preserve_session_keys_after_logout end |
#redirect_path_after_login ⇒ Object
Returns the value of attribute redirect_path_after_login
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def redirect_path_after_login @redirect_path_after_login end |
#redirect_path_after_register ⇒ Object
Returns the value of attribute redirect_path_after_register
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def redirect_path_after_register @redirect_path_after_register end |
#redirect_path_after_settings_change ⇒ Object
Returns the value of attribute redirect_path_after_settings_change
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def redirect_path_after_settings_change @redirect_path_after_settings_change end |
#register_view ⇒ Object
Returns the value of attribute register_view
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def register_view @register_view end |
#token_generator ⇒ Object
Returns the value of attribute token_generator
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def token_generator @token_generator end |
#user_finder_by_email ⇒ Object
Returns the value of attribute user_finder_by_email
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def user_finder_by_email @user_finder_by_email end |
#user_finder_by_id ⇒ Object
Returns the value of attribute user_finder_by_id
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def user_finder_by_id @user_finder_by_id end |
#user_finder_by_token ⇒ Object
Returns the value of attribute user_finder_by_token
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def user_finder_by_token @user_finder_by_token end |
#user_initializer ⇒ Object
Returns the value of attribute user_initializer
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def user_initializer @user_initializer end |
#user_name_method ⇒ Object
Returns the value of attribute user_name_method
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def user_name_method @user_name_method end |
#validate_registration ⇒ Object
Returns the value of attribute validate_registration
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def validate_registration @validate_registration end |
#verify_view ⇒ Object
Returns the value of attribute verify_view
21 22 23 |
# File 'lib/searls/auth/config.rb', line 21 def verify_view @verify_view end |
Instance Method Details
#password_present?(user) ⇒ Boolean
111 112 113 114 115 116 |
# File 'lib/searls/auth/config.rb', line 111 def password_present?(user) predicate = password_present_predicate return false if predicate.nil? predicate.call(user) end |
#password_reset_enabled? ⇒ Boolean
107 108 109 |
# File 'lib/searls/auth/config.rb', line 107 def password_reset_enabled? auth_methods.include?(:password) && password_reset_enabled end |
#resolve(option, *args) ⇒ Object
Get values from values that might be procs
101 102 103 104 105 |
# File 'lib/searls/auth/config.rb', line 101 def resolve(option, *args) key = option.to_sym value = public_send(key) value.respond_to?(:call) ? value.call(*args) : value end |
#validate! ⇒ Object
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/searls/auth/config.rb', line 118 def validate! validate_auth_methods! validate_email_verification_mode! validate_core_hooks! validate_password_settings! validate_default_user_hooks! rescue => e unless [ "PG::UndefinedTable", "ActiveRecord::NoDatabaseError", "ActiveRecord::StatementInvalid" ].include?(e.class.inspect) # don't validate when connection isn't esstablished raise end end |