class Nyauth::Configuration

Attributes

confirmation_expire_limit[RW]
encryption_secret[RW]
mail_delivery_method[RW]
mailer_sender[RW]
password_digest_stretches[RW]
password_minium[RW]
redirect_path_after_create_request_confirmation[RW]
redirect_path_after_registration[RW]
redirect_path_after_reset_password[RW]
redirect_path_after_reset_password_request[RW]
redirect_path_after_sign_in[RW]
redirect_path_after_sign_out[RW]
redirect_path_after_update_confirmation[RW]
redirect_path_after_update_password[RW]
redirect_path_block[RW]
reset_password_expire_limit[RW]

Public Class Methods

new() click to toggle source
# File lib/nyauth/configuration.rb, line 22
def initialize
  @redirect_path_after_sign_in = Proc.new {}
  @redirect_path_after_sign_out = Proc.new {}
  @redirect_path_after_registration = Proc.new {}
  @redirect_path_after_create_request_confirmation = Proc.new {}
  @redirect_path_after_update_confirmation = Proc.new {}
  @redirect_path_after_reset_password_request = Proc.new {}
  @redirect_path_after_reset_password = Proc.new {}
  @redirect_path_after_update_password = Proc.new {}
  @confirmation_expire_limit = 1.hour
  @reset_password_expire_limit = 1.hour
  @password_minium = 8
  @password_digest_stretches = 1000
  @encryption_secret = ENV['NYAUTH_ENCRYPTION_SECRET']
  @mail_delivery_method = :deliver_now
  @use_cookie_auth = false
  @mailer_sender = 'from@example.com'
  @redirect_path_block = Proc.new {}
end

Public Instance Methods

redirect_path(&block) click to toggle source
# File lib/nyauth/configuration.rb, line 42
def redirect_path(&block)
  @redirect_path_block = block
end
setup_redirect_path() click to toggle source
# File lib/nyauth/configuration.rb, line 46
def setup_redirect_path
  UrlHelper.class_eval do
    include Rails.application.routes.url_helpers
  end
  @redirect_path_block.call(UrlHelper.new)
end