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

/config/initializers/devise.rb

http://supper-wriless-network.googlecode.com/
Ruby | 151 lines | 16 code | 28 blank | 107 comment | 0 complexity | 034b1c04bb2c360d8a80106211fdf8ac MD5 | raw file
Possible License(s): BSD-3-Clause
  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 = "13922273218@139.com"
  7. ActionMailer::Base.smtp_settings = {
  8. :address => 'smtp.139.com',
  9. :port => 25,
  10. :domain => '139.com',
  11. :user_name => '13922273218',
  12. :password => 'chutingshao',
  13. :authentication => :login
  14. }
  15. # Configure the class responsible to send e-mails.
  16. config.mailer = "Devise::Mailer"
  17. # ==> ORM configuration
  18. # Load and configure the ORM. Supports :active_record (default) and
  19. # :mongoid (bson_ext recommended) by default. Other ORMs may be
  20. # available as additional gems.
  21. require 'devise/orm/active_record'
  22. # ==> Configuration for any authentication mechanism
  23. # Configure which keys are used when authenticating an user. By default is
  24. # just :email. You can configure it to use [:username, :subdomain], so for
  25. # authenticating an user, both parameters are required. Remember that those
  26. # parameters are used only when authenticating and not when retrieving from
  27. # session. If you need permissions, you should implement that in a before filter.
  28. # config.authentication_keys = [ :email ]
  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. # Set this to true to use Basic Auth for AJAX requests. True by default.
  34. # config.http_authenticatable_on_xhr = true
  35. # The realm used in Http Basic Authentication
  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. # Define which will be the encryption algorithm. Devise also supports encryptors
  42. # from others authentication tools as :clearance_sha1, :authlogic_sha512 (then
  43. # you should set stretches above to 20 for default behavior) and :restful_authentication_sha1
  44. # (then you should set stretches to 10, and copy REST_AUTH_SITE_KEY to pepper)
  45. config.encryptor = :bcrypt
  46. # Setup a pepper to generate the encrypted password.
  47. config.pepper = "4e20e37d6a0707fed71c94e47522a7401eb7dd10ce9bb0958e2d1ecd6f9df9d2185058e5d485f4695d14d65826b7c145b576e4b45087abc66d576b0cd14bae39"
  48. # ==> Configuration for :confirmable
  49. # The time you want to give your user to confirm his account. During this time
  50. # he will be able to access your application without confirming. Default is nil.
  51. # When confirm_within is zero, the user won't be able to sign in without confirming.
  52. # You can use this to let your user access some features of your application
  53. # without confirming the account, but blocking it after a certain period
  54. # (ie 2 days).
  55. # config.confirm_within = 2.days
  56. # ==> Configuration for :rememberable
  57. # The time the user will be remembered without asking for credentials again.
  58. # config.remember_for = 2.weeks
  59. # If true, a valid remember token can be re-used between multiple browsers.
  60. # config.remember_across_browsers = true
  61. # If true, extends the user's remember period when remembered via cookie.
  62. # config.extend_remember_period = false
  63. # ==> Configuration for :validatable
  64. # Range for password length
  65. # config.password_length = 6..20
  66. # Regex to use to validate the email address
  67. # config.email_regexp = /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i
  68. # ==> Configuration for :timeoutable
  69. # The time you want to timeout the user session without activity. After this
  70. # time the user will be asked for credentials again.
  71. # config.timeout_in = 10.minutes
  72. # ==> Configuration for :lockable
  73. # Defines which strategy will be used to lock an account.
  74. # :failed_attempts = Locks an account after a number of failed attempts to sign in.
  75. # :none = No lock strategy. You should handle locking by yourself.
  76. # config.lock_strategy = :failed_attempts
  77. # Defines which strategy will be used to unlock an account.
  78. # :email = Sends an unlock link to the user email
  79. # :time = Re-enables login after a certain amount of time (see :unlock_in below)
  80. # :both = Enables both strategies
  81. # :none = No unlock strategy. You should handle unlocking by yourself.
  82. # config.unlock_strategy = :both
  83. # Number of authentication tries before locking an account if lock_strategy
  84. # is failed attempts.
  85. # config.maximum_attempts = 20
  86. # Time interval to unlock the account if :time is enabled as unlock_strategy.
  87. # config.unlock_in = 1.hour
  88. # ==> Configuration for :token_authenticatable
  89. # Defines name of the authentication token params key
  90. # config.token_authentication_key = :auth_token
  91. # ==> Scopes configuration
  92. # Turn scoped views on. Before rendering "sessions/new", it will first check for
  93. # "users/sessions/new". It's turned off by default because it's slower if you
  94. # are using only default views.
  95. # config.scoped_views = true
  96. # Configure the default scope given to Warden. By default it's the first
  97. # devise role declared in your routes.
  98. # config.default_scope = :user
  99. # Configure sign_out behavior.
  100. # By default sign_out is scoped (i.e. /users/sign_out affects only :user scope).
  101. # In case of sign_out_all_scopes set to true any logout action will sign out all active scopes.
  102. # config.sign_out_all_scopes = false
  103. # ==> Navigation configuration
  104. # Lists the formats that should be treated as navigational. Formats like
  105. # :html, should redirect to the sign in page when the user does not have
  106. # access, but formats like :xml or :json, should return 401.
  107. # If you have any extra navigational formats, like :iphone or :mobile, you
  108. # should add them to the navigational formats lists. Default is [:html]
  109. # config.navigational_formats = [:html, :iphone]
  110. # ==> Warden configuration
  111. # If you want to use other strategies, that are not (yet) supported by Devise,
  112. # you can configure them inside the config.warden block. The example below
  113. # allows you to setup OAuth, using http://github.com/roman/warden_oauth
  114. #
  115. # config.warden do |manager|
  116. # manager.oauth(:twitter) do |twitter|
  117. # twitter.consumer_secret = <YOUR CONSUMER SECRET>
  118. # twitter.consumer_key = <YOUR CONSUMER KEY>
  119. # twitter.options :site => 'http://twitter.com'
  120. # end
  121. # manager.default_strategies(:scope => :user).unshift :twitter_oauth
  122. # end
  123. end