Class: Nyauth::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/nyauth/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# 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 = '[email protected]'
  @redirect_path_block = Proc.new {}
end

Instance Attribute Details

#confirmation_expire_limitObject

Returns the value of attribute confirmation_expire_limit.



3
4
5
# File 'lib/nyauth/configuration.rb', line 3

def confirmation_expire_limit
  @confirmation_expire_limit
end

#encryption_secretObject

Returns the value of attribute encryption_secret.



3
4
5
# File 'lib/nyauth/configuration.rb', line 3

def encryption_secret
  @encryption_secret
end

#mail_delivery_methodObject

Returns the value of attribute mail_delivery_method.



3
4
5
# File 'lib/nyauth/configuration.rb', line 3

def mail_delivery_method
  @mail_delivery_method
end

#mailer_senderObject

Returns the value of attribute mailer_sender.



3
4
5
# File 'lib/nyauth/configuration.rb', line 3

def mailer_sender
  @mailer_sender
end

#password_digest_stretchesObject

Returns the value of attribute password_digest_stretches.



3
4
5
# File 'lib/nyauth/configuration.rb', line 3

def password_digest_stretches
  @password_digest_stretches
end

#password_miniumObject

Returns the value of attribute password_minium.



3
4
5
# File 'lib/nyauth/configuration.rb', line 3

def password_minium
  @password_minium
end

#redirect_path_after_create_request_confirmationObject

Returns the value of attribute redirect_path_after_create_request_confirmation.



3
4
5
# File 'lib/nyauth/configuration.rb', line 3

def redirect_path_after_create_request_confirmation
  @redirect_path_after_create_request_confirmation
end

#redirect_path_after_registrationObject

Returns the value of attribute redirect_path_after_registration.



3
4
5
# File 'lib/nyauth/configuration.rb', line 3

def redirect_path_after_registration
  @redirect_path_after_registration
end

#redirect_path_after_reset_passwordObject

Returns the value of attribute redirect_path_after_reset_password.



3
4
5
# File 'lib/nyauth/configuration.rb', line 3

def redirect_path_after_reset_password
  @redirect_path_after_reset_password
end

#redirect_path_after_reset_password_requestObject

Returns the value of attribute redirect_path_after_reset_password_request.



3
4
5
# File 'lib/nyauth/configuration.rb', line 3

def redirect_path_after_reset_password_request
  @redirect_path_after_reset_password_request
end

#redirect_path_after_sign_inObject

Returns the value of attribute redirect_path_after_sign_in.



3
4
5
# File 'lib/nyauth/configuration.rb', line 3

def 
  @redirect_path_after_sign_in
end

#redirect_path_after_sign_outObject

Returns the value of attribute redirect_path_after_sign_out.



3
4
5
# File 'lib/nyauth/configuration.rb', line 3

def redirect_path_after_sign_out
  @redirect_path_after_sign_out
end

#redirect_path_after_update_confirmationObject

Returns the value of attribute redirect_path_after_update_confirmation.



3
4
5
# File 'lib/nyauth/configuration.rb', line 3

def redirect_path_after_update_confirmation
  @redirect_path_after_update_confirmation
end

#redirect_path_after_update_passwordObject

Returns the value of attribute redirect_path_after_update_password.



3
4
5
# File 'lib/nyauth/configuration.rb', line 3

def redirect_path_after_update_password
  @redirect_path_after_update_password
end

#redirect_path_blockObject

Returns the value of attribute redirect_path_block.



3
4
5
# File 'lib/nyauth/configuration.rb', line 3

def redirect_path_block
  @redirect_path_block
end

#reset_password_expire_limitObject

Returns the value of attribute reset_password_expire_limit.



3
4
5
# File 'lib/nyauth/configuration.rb', line 3

def reset_password_expire_limit
  @reset_password_expire_limit
end

Returns the value of attribute use_cookie_auth.



3
4
5
# File 'lib/nyauth/configuration.rb', line 3

def use_cookie_auth
  @use_cookie_auth
end

Instance Method Details

#redirect_path(&block) ⇒ Object



42
43
44
# File 'lib/nyauth/configuration.rb', line 42

def redirect_path(&block)
  @redirect_path_block = block
end

#setup_redirect_pathObject



46
47
48
49
50
51
# 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