PageRenderTime 54ms CodeModel.GetById 27ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/generators/templates/devise.rb

https://github.com/welcu/devise
Ruby | 164 lines | 7 code | 32 blank | 125 comment | 0 complexity | abf5fafe502dca5cff0342629c8075be MD5 | raw file
  1. # Use this hook to configure devise mailer, warden hooks and so forth. The first
  2. # four configuration values can also be set straight in your models.
  3. Devise.setup do |config|
  4. # ==> Mailer Configuration
  5. # Configure the e-mail address which will be shown in DeviseMailer.
  6. config.mailer_sender = "please-change-me@config-initializers-devise.com"
  7. # Configure the class responsible to send e-mails.
  8. # config.mailer = "Devise::Mailer"
  9. # ==> ORM configuration
  10. # Load and configure the ORM. Supports :active_record (default) and
  11. # :mongoid (bson_ext recommended) by default. Other ORMs may be
  12. # available as additional gems.
  13. require 'devise/orm/<%= options[:orm] %>'
  14. # ==> Configuration for any authentication mechanism
  15. # Configure which keys are used when authenticating an user. By default is
  16. # just :email. You can configure it to use [:username, :subdomain], so for
  17. # authenticating an user, both parameters are required. Remember that those
  18. # parameters are used only when authenticating and not when retrieving from
  19. # session. If you need permissions, you should implement that in a before filter.
  20. # You can also supply hash where the value is a boolean expliciting if authentication
  21. # should be aborted or not if the value is not present. By default is empty.
  22. # config.authentication_keys = [ :email ]
  23. # Configure parameters from the request object used for authentication. Each entry
  24. # given should be a request method and it will automatically be passed to
  25. # find_for_authentication method and considered in your model lookup. For instance,
  26. # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
  27. # The same considerations mentioned for authentication_keys also apply to request_keys.
  28. # config.request_keys = []
  29. # Tell if authentication through request.params is enabled. True by default.
  30. # config.params_authenticatable = true
  31. # Tell if authentication through HTTP Basic Auth is enabled. False by default.
  32. # config.http_authenticatable = false
  33. # If http headers should be returned for AJAX requests. True by default.
  34. # config.http_authenticatable_on_xhr = true
  35. # The realm used in Http Basic Authentication. "Application" by default.
  36. # config.http_authentication_realm = "Application"
  37. # ==> Configuration for :database_authenticatable
  38. # For bcrypt, this is the cost for hashing the password and defaults to 10. If
  39. # using other encryptors, it sets how many times you want the password re-encrypted.
  40. config.stretches = 10
  41. # ==> Configuration for :confirmable
  42. # The time you want to give your user to confirm his account. During this time
  43. # he will be able to access your application without confirming. Default is nil.
  44. # When confirm_within is zero, the user won't be able to sign in without confirming.
  45. # You can use this to let your user access some features of your application
  46. # without confirming the account, but blocking it after a certain period
  47. # (ie 2 days).
  48. # config.confirm_within = 2.days
  49. # ==> Configuration for :rememberable
  50. # The time the user will be remembered without asking for credentials again.
  51. # config.remember_for = 2.weeks
  52. # If true, a valid remember token can be re-used between multiple browsers.
  53. # config.remember_across_browsers = true
  54. # If true, extends the user's remember period when remembered via cookie.
  55. # config.extend_remember_period = false
  56. # If true, uses the password salt as remember token. This should be turned
  57. # to false if you are not using database authenticatable.
  58. config.use_salt_as_remember_token = true
  59. # ==> Configuration for :validatable
  60. # Range for password length. Default is 6..20.
  61. # config.password_length = 6..20
  62. # Regex to use to validate the email address
  63. # config.email_regexp = /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i
  64. # ==> Configuration for :timeoutable
  65. # The time you want to timeout the user session without activity. After this
  66. # time the user will be asked for credentials again. Default is 30 minutes.
  67. # config.timeout_in = 30.minutes
  68. # ==> Configuration for :lockable
  69. # Defines which strategy will be used to lock an account.
  70. # :failed_attempts = Locks an account after a number of failed attempts to sign in.
  71. # :none = No lock strategy. You should handle locking by yourself.
  72. # config.lock_strategy = :failed_attempts
  73. # Defines which strategy will be used to unlock an account.
  74. # :email = Sends an unlock link to the user email
  75. # :time = Re-enables login after a certain amount of time (see :unlock_in below)
  76. # :both = Enables both strategies
  77. # :none = No unlock strategy. You should handle unlocking by yourself.
  78. # config.unlock_strategy = :both
  79. # Number of authentication tries before locking an account if lock_strategy
  80. # is failed attempts.
  81. # config.maximum_attempts = 20
  82. # Time interval to unlock the account if :time is enabled as unlock_strategy.
  83. # config.unlock_in = 1.hour
  84. # ==> Configuration for :encryptable
  85. # Allow you to use another encryption algorithm besides bcrypt (default). You can use
  86. # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
  87. # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
  88. # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
  89. # REST_AUTH_SITE_KEY to pepper)
  90. # config.encryptor = :sha512
  91. # Setup a pepper to generate the encrypted password.
  92. config.pepper = <%= ActiveSupport::SecureRandom.hex(64).inspect %>
  93. # ==> Configuration for :token_authenticatable
  94. # Defines name of the authentication token params key
  95. # config.token_authentication_key = :auth_token
  96. # If true, authentication through token does not store user in session and needs
  97. # to be supplied on each request. Useful if you are using the token as API token.
  98. # config.stateless_token = false
  99. # ==> Scopes configuration
  100. # Turn scoped views on. Before rendering "sessions/new", it will first check for
  101. # "users/sessions/new". It's turned off by default because it's slower if you
  102. # are using only default views.
  103. # config.scoped_views = false
  104. # Configure the default scope given to Warden. By default it's the first
  105. # devise role declared in your routes (usually :user).
  106. # config.default_scope = :user
  107. # Configure sign_out behavior.
  108. # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
  109. # The default is true, which means any logout action will sign out all active scopes.
  110. # config.sign_out_all_scopes = true
  111. # ==> Navigation configuration
  112. # Lists the formats that should be treated as navigational. Formats like
  113. # :html, should redirect to the sign in page when the user does not have
  114. # access, but formats like :xml or :json, should return 401.
  115. # If you have any extra navigational formats, like :iphone or :mobile, you
  116. # should add them to the navigational formats lists. Default is [:html]
  117. # config.navigational_formats = [:html, :iphone]
  118. # The default HTTP method used to sign out a resource. Default is :get.
  119. # config.sign_out_via = :get
  120. # ==> OmniAuth
  121. # Add a new OmniAuth provider. Check the wiki for more information on setting
  122. # up on your models and hooks.
  123. # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
  124. # ==> Warden configuration
  125. # If you want to use other strategies, that are not supported by Devise, or
  126. # change the failure app, you can configure them inside the config.warden block.
  127. #
  128. # config.warden do |manager|
  129. # manager.failure_app = AnotherApp
  130. # manager.default_strategies(:scope => :user).unshift :some_external_strategy
  131. # end
  132. end