1 # Use this hook to configure devise mailer, warden hooks and so forth.
2 # Many of these configuration options can be set straight in your model.
3 Devise.setup do |config|
4 # ==> Mailer Configuration
5 # Configure the e-mail address which will be shown in Devise::Mailer,
6 # note that it will be overwritten if you use your own mailer class with default "from" parameter.
7 config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
8 config.sign_out_via = :get
10 # Configure the class responsible to send e-mails.
11 # config.mailer = "Devise::Mailer"
13 # ==> ORM configuration
14 # Load and configure the ORM. Supports :active_record (default) and
15 # :mongoid (bson_ext recommended) by default. Other ORMs may be
16 # available as additional gems.
17 require 'devise/orm/active_record'
19 # ==> Configuration for any authentication mechanism
20 # Configure which keys are used when authenticating a user. The default is
21 # just :email. You can configure it to use [:username, :subdomain], so for
22 # authenticating a user, both parameters are required. Remember that those
23 # parameters are used only when authenticating and not when retrieving from
24 # session. If you need permissions, you should implement that in a before filter.
25 # You can also supply a hash where the value is a boolean determining whether
26 # or not authentication should be aborted when the value is not present.
27 # config.authentication_keys = [ :email ]
29 # Configure parameters from the request object used for authentication. Each entry
30 # given should be a request method and it will automatically be passed to the
31 # find_for_authentication method and considered in your model lookup. For instance,
32 # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
33 # The same considerations mentioned for authentication_keys also apply to request_keys.
34 # config.request_keys = []
36 # Configure which authentication keys should be case-insensitive.
37 # These keys will be downcased upon creating or modifying a user and when used
38 # to authenticate or find a user. Default is :email.
39 config.case_insensitive_keys = [ :email ]
41 # Configure which authentication keys should have whitespace stripped.
42 # These keys will have whitespace before and after removed upon creating or
43 # modifying a user and when used to authenticate or find a user. Default is :email.
44 config.strip_whitespace_keys = [ :email ]
46 # Tell if authentication through request.params is enabled. True by default.
47 # config.params_authenticatable = true
49 # Tell if authentication through HTTP Basic Auth is enabled. False by default.
50 # config.http_authenticatable = false
52 # If http headers should be returned for AJAX requests. True by default.
53 config.http_authenticatable_on_xhr = true
55 # The realm used in Http Basic Authentication. "Application" by default.
56 # config.http_authentication_realm = "Application"
58 # It will change confirmation, password recovery and other workflows
59 # to behave the same regardless if the e-mail provided was right or wrong.
60 # Does not affect registerable.
61 # config.paranoid = true
63 # ==> Configuration for :database_authenticatable
64 # For bcrypt, this is the cost for hashing the password and defaults to 10. If
65 # using other encryptors, it sets how many times you want the password re-encrypted.
67 # Limiting the stretches to just one in testing will increase the performance of
68 # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
69 # a value less than 10 in other environments.
70 config.stretches = Rails.env.test? ? 1 : 10
72 # Setup a pepper to generate the encrypted password.
73 # config.pepper = "7835fc9cebff957984851fd2936fbfb6593439b1ebf26dbe6e3da1554a12dfaaa6e551ad7b4681d07ccaf66cd73cf9440cd54c75e0d85caa27f605118b1456b0"
75 # ==> Configuration for :confirmable
76 # A period that the user is allowed to access the website even without
77 # confirming his account. For instance, if set to 2.days, the user will be
78 # able to access the website for two days without confirming his account,
79 # access will be blocked just in the third day. Default is 0.days, meaning
80 # the user cannot access the website without confirming his account.
81 # config.confirm_within = 2.days
83 # Defines which key will be used when confirming an account
84 # config.confirmation_keys = [ :email ]
86 # ==> Configuration for :rememberable
87 # The time the user will be remembered without asking for credentials again.
88 # config.remember_for = 2.weeks
90 # If true, a valid remember token can be re-used between multiple browsers.
91 # config.remember_across_browsers = true
93 # If true, extends the user's remember period when remembered via cookie.
94 # config.extend_remember_period = false
96 # If true, uses the password salt as remember token. This should be turned
97 # to false if you are not using database authenticatable.
98 config.use_salt_as_remember_token = true
100 # Options to be passed to the created cookie. For instance, you can set
101 # :secure => true in order to force SSL only cookies.
102 # config.cookie_options = {}
104 # ==> Configuration for :validatable
105 # Range for password length. Default is 6..128.
106 # config.password_length = 6..128
108 # Email regex used to validate email formats. It simply asserts that
109 # an one (and only one) @ exists in the given string. This is mainly
110 # to give user feedback and not to assert the e-mail validity.
111 # config.email_regexp = /\A[^@]+@[^@]+\z/
113 # ==> Configuration for :timeoutable
114 # The time you want to timeout the user session without activity. After this
115 # time the user will be asked for credentials again. Default is 30 minutes.
116 # config.timeout_in = 30.minutes
118 # ==> Configuration for :lockable
119 # Defines which strategy will be used to lock an account.
120 # :failed_attempts = Locks an account after a number of failed attempts to sign in.
121 # :none = No lock strategy. You should handle locking by yourself.
122 # config.lock_strategy = :failed_attempts
124 # Defines which key will be used when locking and unlocking an account
125 # config.unlock_keys = [ :email ]
127 # Defines which strategy will be used to unlock an account.
128 # :email = Sends an unlock link to the user email
129 # :time = Re-enables login after a certain amount of time (see :unlock_in below)
130 # :both = Enables both strategies
131 # :none = No unlock strategy. You should handle unlocking by yourself.
132 # config.unlock_strategy = :both
134 # Number of authentication tries before locking an account if lock_strategy
135 # is failed attempts.
136 # config.maximum_attempts = 20
138 # Time interval to unlock the account if :time is enabled as unlock_strategy.
139 # config.unlock_in = 1.hour
141 # ==> Configuration for :recoverable
143 # Defines which key will be used when recovering the password for an account
144 # config.reset_password_keys = [ :email ]
146 # Time interval you can reset your password with a reset password key.
147 # Don't put a too small interval or your users won't have the time to
148 # change their passwords.
149 config.reset_password_within = 2.hours
151 # ==> Configuration for :encryptable
152 # Allow you to use another encryption algorithm besides bcrypt (default). You can use
153 # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
154 # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
155 # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
156 # REST_AUTH_SITE_KEY to pepper)
157 # config.encryptor = :sha512
159 # ==> Configuration for :token_authenticatable
160 # Defines name of the authentication token params key
161 config.token_authentication_key = :auth_token
163 # If true, authentication through token does not store user in session and needs
164 # to be supplied on each request. Useful if you are using the token as API token.
165 # config.stateless_token = false
167 # ==> Scopes configuration
168 # Turn scoped views on. Before rendering "sessions/new", it will first check for
169 # "users/sessions/new". It's turned off by default because it's slower if you
170 # are using only default views.
171 config.scoped_views = true
173 # Configure the default scope given to Warden. By default it's the first
174 # devise role declared in your routes (usually :user).
175 # config.default_scope = :user
177 # Configure sign_out behavior.
178 # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
179 # The default is true, which means any logout action will sign out all active scopes.
180 # config.sign_out_all_scopes = true
182 # ==> Navigation configuration
183 # Lists the formats that should be treated as navigational. Formats like
184 # :html, should redirect to the sign in page when the user does not have
185 # access, but formats like :xml or :json, should return 401.
187 # If you have any extra navigational formats, like :iphone or :mobile, you
188 # should add them to the navigational formats lists.
190 # The :"*/*" and "*/*" formats below is required to match Internet
192 config.navigational_formats = [:"*/*", "*/*", :html, :json]
194 # The default HTTP method used to sign out a resource. Default is :delete.
195 config.sign_out_via = :delete
198 # Add a new OmniAuth provider. Check the wiki for more information on setting
199 # up on your models and hooks.
200 # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
202 # ==> Warden configuration
203 # If you want to use other strategies, that are not supported by Devise, or
204 # change the failure app, you can configure them inside the config.warden block.
206 # config.warden do |manager|
207 # manager.intercept_401 = false
208 # manager.default_strategies(:scope => :user).unshift :some_external_strategy