PageRenderTime 65ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/config/initializers/devise.rb

http://our-news.googlecode.com/
Ruby | 194 lines | 10 code | 38 blank | 146 comment | 0 complexity | 9eada61c8eaf76a80b2cec28efa6b329 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-at-config-initializers-devise@example.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/active_record'
  14. # ==> Configuration for any authentication mechanism
  15. # Configure which keys are used when authenticating a user. The default is
  16. # just :email. You can configure it to use [:username, :subdomain], so for
  17. # authenticating a 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 a hash where the value is a boolean determining whether
  21. # or not authentication should be aborted when the value is not present.
  22. config.authentication_keys = [ :login ]
  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 the
  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. # Configure which authentication keys should be case-insensitive.
  30. # These keys will be downcased upon creating or modifying a user and when used
  31. # to authenticate or find a user. Default is :email.
  32. config.case_insensitive_keys = [ :email ]
  33. # Tell if authentication through request.params is enabled. True by default.
  34. # config.params_authenticatable = true
  35. # Tell if authentication through HTTP Basic Auth is enabled. False by default.
  36. # config.http_authenticatable = false
  37. # If http headers should be returned for AJAX requests. True by default.
  38. # config.http_authenticatable_on_xhr = true
  39. # The realm used in Http Basic Authentication. "Application" by default.
  40. # config.http_authentication_realm = "Application"
  41. # ==> Configuration for :database_authenticatable
  42. # For bcrypt, this is the cost for hashing the password and defaults to 10. If
  43. # using other encryptors, it sets how many times you want the password re-encrypted.
  44. config.stretches = 10
  45. # Setup a pepper to generate the encrypted password.
  46. # config.pepper = "48c99cac43b83d7def52598c2b2c6f1fd5f6988e083a7b66f153c50e0a74730c1f761b7daae2b6f8810d200c973294732d551e11a9aa80d6c22f3edfaacd0010"
  47. # ==> Configuration for :confirmable
  48. # The time you want to give your user to confirm his account. During this time
  49. # he will be able to access your application without confirming. Default is 0.days
  50. # When confirm_within is zero, the user won't be able to sign in without confirming.
  51. # You can use this to let your user access some features of your application
  52. # without confirming the account, but blocking it after a certain period
  53. # (ie 2 days).
  54. # config.confirm_within = 2.days
  55. # Defines which key will be used when confirming an account
  56. # config.confirmation_keys = [ :email ]
  57. # ==> Configuration for :rememberable
  58. # The time the user will be remembered without asking for credentials again.
  59. # config.remember_for = 2.weeks
  60. # If true, a valid remember token can be re-used between multiple browsers.
  61. # config.remember_across_browsers = true
  62. # If true, extends the user's remember period when remembered via cookie.
  63. # config.extend_remember_period = false
  64. # If true, uses the password salt as remember token. This should be turned
  65. # to false if you are not using database authenticatable.
  66. config.use_salt_as_remember_token = true
  67. # Options to be passed to the created cookie. For instance, you can set
  68. # :secure => true in order to force SSL only cookies.
  69. # config.cookie_options = {}
  70. # ==> Configuration for :validatable
  71. # Range for password length. Default is 6..128.
  72. # config.password_length = 6..128
  73. # Regex to use to validate the email address
  74. # config.email_regexp = /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i
  75. # ==> Configuration for :timeoutable
  76. # The time you want to timeout the user session without activity. After this
  77. # time the user will be asked for credentials again. Default is 30 minutes.
  78. # config.timeout_in = 30.minutes
  79. # ==> Configuration for :lockable
  80. # Defines which strategy will be used to lock an account.
  81. # :failed_attempts = Locks an account after a number of failed attempts to sign in.
  82. # :none = No lock strategy. You should handle locking by yourself.
  83. # config.lock_strategy = :failed_attempts
  84. # Defines which key will be used when locking and unlocking an account
  85. # config.unlock_keys = [ :email ]
  86. # Defines which strategy will be used to unlock an account.
  87. # :email = Sends an unlock link to the user email
  88. # :time = Re-enables login after a certain amount of time (see :unlock_in below)
  89. # :both = Enables both strategies
  90. # :none = No unlock strategy. You should handle unlocking by yourself.
  91. # config.unlock_strategy = :both
  92. # Number of authentication tries before locking an account if lock_strategy
  93. # is failed attempts.
  94. # config.maximum_attempts = 20
  95. # Time interval to unlock the account if :time is enabled as unlock_strategy.
  96. # config.unlock_in = 1.hour
  97. # ==> Configuration for :recoverable
  98. #
  99. # Defines which key will be used when recovering the password for an account
  100. # config.reset_password_keys = [ :email ]
  101. # Time interval you can reset your password with a reset password key.
  102. # Don't put a too small interval or your users won't have the time to
  103. # change their passwords.
  104. config.reset_password_within = 2.hours
  105. # ==> Configuration for :encryptable
  106. # Allow you to use another encryption algorithm besides bcrypt (default). You can use
  107. # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
  108. # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
  109. # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
  110. # REST_AUTH_SITE_KEY to pepper)
  111. # config.encryptor = :sha512
  112. # ==> Configuration for :token_authenticatable
  113. # Defines name of the authentication token params key
  114. # config.token_authentication_key = :auth_token
  115. # If true, authentication through token does not store user in session and needs
  116. # to be supplied on each request. Useful if you are using the token as API token.
  117. # config.stateless_token = false
  118. # ==> Scopes configuration
  119. # Turn scoped views on. Before rendering "sessions/new", it will first check for
  120. # "users/sessions/new". It's turned off by default because it's slower if you
  121. # are using only default views.
  122. config.scoped_views = true
  123. # Configure the default scope given to Warden. By default it's the first
  124. # devise role declared in your routes (usually :user).
  125. # config.default_scope = :user
  126. # Configure sign_out behavior.
  127. # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
  128. # The default is true, which means any logout action will sign out all active scopes.
  129. # config.sign_out_all_scopes = true
  130. # ==> Navigation configuration
  131. # Lists the formats that should be treated as navigational. Formats like
  132. # :html, should redirect to the sign in page when the user does not have
  133. # access, but formats like :xml or :json, should return 401.
  134. #
  135. # If you have any extra navigational formats, like :iphone or :mobile, you
  136. # should add them to the navigational formats lists.
  137. #
  138. # The :"*/*" and "*/*" formats below is required to match Internet
  139. # Explorer requests.
  140. # config.navigational_formats = [:"*/*", "*/*", :html]
  141. # The default HTTP method used to sign out a resource. Default is :get.
  142. # config.sign_out_via = :get
  143. # ==> OmniAuth
  144. # Add a new OmniAuth provider. Check the wiki for more information on setting
  145. # up on your models and hooks.
  146. # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
  147. # ==> Warden configuration
  148. # If you want to use other strategies, that are not supported by Devise, or
  149. # change the failure app, you can configure them inside the config.warden block.
  150. #
  151. # config.warden do |manager|
  152. # manager.failure_app = AnotherApp
  153. # manager.intercept_401 = false
  154. # manager.default_strategies(:scope => :user).unshift :some_external_strategy
  155. # end
  156. end