phcdevworks_accounts 3.2.4 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -20
  3. data/README.md +7 -7
  4. data/Rakefile +8 -8
  5. data/app/assets/config/phcdevworks_accounts_manifest.js +3 -3
  6. data/app/assets/stylesheets/phcdevworks_accounts/admin/pages.scss +3 -3
  7. data/app/assets/stylesheets/phcdevworks_accounts/application.scss +0 -0
  8. data/app/assets/stylesheets/phcdevworks_accounts/user/pages.scss +3 -3
  9. data/app/controllers/phcdevworks_accounts/admin/pages_controller.rb +25 -25
  10. data/app/controllers/phcdevworks_accounts/application_controller.rb +25 -25
  11. data/app/controllers/phcdevworks_accounts/user/pages_controller.rb +15 -15
  12. data/app/controllers/users/confirmations_controller.rb +30 -30
  13. data/app/controllers/users/omniauth_callbacks_controller.rb +30 -30
  14. data/app/controllers/users/passwords_controller.rb +34 -34
  15. data/app/controllers/users/registrations_controller.rb +74 -74
  16. data/app/controllers/users/sessions_controller.rb +27 -27
  17. data/app/controllers/users/unlocks_controller.rb +30 -30
  18. data/app/helpers/phcdevworks_accounts/admin/pages_helper.rb +4 -4
  19. data/app/helpers/phcdevworks_accounts/application_helper.rb +4 -4
  20. data/app/helpers/phcdevworks_accounts/user/pages_helper.rb +4 -4
  21. data/app/jobs/phcdevworks_accounts/application_job.rb +4 -4
  22. data/app/mailers/phcdevworks_accounts/application_mailer.rb +6 -6
  23. data/app/models/phcdevworks_accounts/application_record.rb +5 -5
  24. data/app/models/phcdevworks_accounts/user.rb +39 -39
  25. data/app/views/layouts/phcdevworks_accounts/application.html.erb +66 -66
  26. data/app/views/layouts/phcdevworks_accounts/application_full_width.html.erb +66 -66
  27. data/app/views/layouts/phcdevworks_accounts/application_no_sidebar.html.erb +59 -59
  28. data/app/views/layouts/phcdevworks_accounts/application_profile.html.erb +65 -65
  29. data/app/views/layouts/phcdevworks_accounts/components/backend/footer/_footer.html.erb +0 -0
  30. data/app/views/layouts/phcdevworks_accounts/components/backend/navigation/_top_menu.html.erb +0 -0
  31. data/app/views/layouts/phcdevworks_accounts/components/backend/sidebars/_side_menu.html.erb +0 -0
  32. data/app/views/layouts/phcdevworks_accounts/devise.html.erb +0 -0
  33. data/app/views/phcdevworks_accounts/admin/pages/components/_profile_header.html.erb +27 -27
  34. data/app/views/phcdevworks_accounts/admin/pages/dashboard.html.erb +0 -0
  35. data/app/views/phcdevworks_accounts/admin/pages/user_profile.html.erb +22 -22
  36. data/app/views/phcdevworks_accounts/admin/pages/users_list.html.erb +72 -72
  37. data/app/views/phcdevworks_accounts/user/pages/dashboard.html.erb +0 -0
  38. data/app/views/phcdevworks_accounts/user/pages/profile.html.erb +0 -0
  39. data/app/views/users/confirmations/new.html.erb +62 -62
  40. data/app/views/users/mailer/confirmation_instructions.html.erb +5 -5
  41. data/app/views/users/mailer/email_changed.html.erb +7 -7
  42. data/app/views/users/mailer/password_change.html.erb +3 -3
  43. data/app/views/users/mailer/reset_password_instructions.html.erb +8 -8
  44. data/app/views/users/mailer/unlock_instructions.html.erb +7 -7
  45. data/app/views/users/passwords/edit.html.erb +78 -78
  46. data/app/views/users/passwords/new.html.erb +65 -65
  47. data/app/views/users/registrations/edit.html.erb +101 -101
  48. data/app/views/users/registrations/new.html.erb +114 -114
  49. data/app/views/users/sessions/new.html.erb +86 -86
  50. data/app/views/users/shared/_links.html.erb +25 -25
  51. data/app/views/users/unlocks/new.html.erb +62 -62
  52. data/config/initializers/devise.rb +310 -310
  53. data/config/locales/devise.en.yml +65 -65
  54. data/config/routes.rb +19 -19
  55. data/config/spring.rb +1 -1
  56. data/db/migrate/20191012042035_devise_create_phcdevworks_accounts_users.rb +46 -46
  57. data/db/migrate/20191012060241_add_userinfo_to_users.rb +15 -15
  58. data/db/migrate/20191012060308_add_role_to_users.rb +7 -7
  59. data/db/migrate/20191012060324_add_tos_to_users.rb +7 -7
  60. data/db/migrate/20210407121952_add_customer_id_to_users.rb +7 -7
  61. data/db/migrate/20210425060053_add_subscription_id_to_users.rb +7 -7
  62. data/lib/phcdevworks_accounts/engine.rb +48 -48
  63. data/lib/phcdevworks_accounts/version.rb +3 -3
  64. data/lib/phcdevworks_accounts.rb +6 -6
  65. data/lib/tasks/phcdevworks_accounts_tasks.rake +4 -4
  66. metadata +31 -31
@@ -1,310 +1,310 @@
1
- # frozen_string_literal: true
2
-
3
- # Use this hook to configure devise mailer, warden hooks and so forth.
4
- # Many of these configuration options can be set straight in your model.
5
- Devise.setup do |config|
6
-
7
- # The secret key used by Devise. Devise uses this key to generate
8
- # random tokens. Changing this key will render invalid all existing
9
- # confirmation, reset password and unlock tokens in the database.
10
- # Devise will use the `secret_key_base` as its `secret_key`
11
- # by default. You can change it below and use your own secret key.
12
- config.secret_key = ENV['SECRET_KEY_BASE'] if Rails.env.production?
13
-
14
- # ==> Controller configuration
15
- # Configure the parent class to the devise controllers.
16
- config.parent_controller = 'PhcdevworksAccounts::ApplicationController'
17
-
18
- # ==> Mailer Configuration
19
- # Configure the e-mail address which will be shown in Devise::Mailer,
20
- # note that it will be overwritten if you use your own mailer class
21
- # with default "from" parameter.
22
- config.mailer_sender = ENV['PHCDEV_EMAIL_SENDER']
23
-
24
- # Configure the class responsible to send e-mails.
25
- # config.mailer = 'Devise::Mailer'
26
-
27
- # Configure the parent class responsible to send e-mails.
28
- # config.parent_mailer = 'ActionMailer::Base'
29
-
30
- # ==> ORM configuration
31
- # Load and configure the ORM. Supports :active_record (default) and
32
- # :mongoid (bson_ext recommended) by default. Other ORMs may be
33
- # available as additional gems.
34
- require 'devise/orm/active_record'
35
-
36
- # ==> Configuration for any authentication mechanism
37
- # Configure which keys are used when authenticating a user. The default is
38
- # just :email. You can configure it to use [:username, :subdomain], so for
39
- # authenticating a user, both parameters are required. Remember that those
40
- # parameters are used only when authenticating and not when retrieving from
41
- # session. If you need permissions, you should implement that in a before filter.
42
- # You can also supply a hash where the value is a boolean determining whether
43
- # or not authentication should be aborted when the value is not present.
44
- # config.authentication_keys = [:email]
45
-
46
- # Configure parameters from the request object used for authentication. Each entry
47
- # given should be a request method and it will automatically be passed to the
48
- # find_for_authentication method and considered in your model lookup. For instance,
49
- # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
50
- # The same considerations mentioned for authentication_keys also apply to request_keys.
51
- # config.request_keys = []
52
-
53
- # Configure which authentication keys should be case-insensitive.
54
- # These keys will be downcased upon creating or modifying a user and when used
55
- # to authenticate or find a user. Default is :email.
56
- config.case_insensitive_keys = [:email]
57
-
58
- # Configure which authentication keys should have whitespace stripped.
59
- # These keys will have whitespace before and after removed upon creating or
60
- # modifying a user and when used to authenticate or find a user. Default is :email.
61
- config.strip_whitespace_keys = [:email]
62
-
63
- # Tell if authentication through request.params is enabled. True by default.
64
- # It can be set to an array that will enable params authentication only for the
65
- # given strategies, for example, `config.params_authenticatable = [:database]` will
66
- # enable it only for database (email + password) authentication.
67
- # config.params_authenticatable = true
68
-
69
- # Tell if authentication through HTTP Auth is enabled. False by default.
70
- # It can be set to an array that will enable http authentication only for the
71
- # given strategies, for example, `config.http_authenticatable = [:database]` will
72
- # enable it only for database authentication. The supported strategies are:
73
- # :database = Support basic authentication with authentication key + password
74
- # config.http_authenticatable = false
75
-
76
- # If 401 status code should be returned for AJAX requests. True by default.
77
- # config.http_authenticatable_on_xhr = true
78
-
79
- # The realm used in Http Basic Authentication. 'Application' by default.
80
- # config.http_authentication_realm = 'Application'
81
-
82
- # It will change confirmation, password recovery and other workflows
83
- # to behave the same regardless if the e-mail provided was right or wrong.
84
- # Does not affect registerable.
85
- # config.paranoid = true
86
-
87
- # By default Devise will store the user in session. You can skip storage for
88
- # particular strategies by setting this option.
89
- # Notice that if you are skipping storage for all authentication paths, you
90
- # may want to disable generating routes to Devise's sessions controller by
91
- # passing skip: :sessions to `devise_for` in your config/routes.rb
92
- config.skip_session_storage = [:http_auth]
93
-
94
- # By default, Devise cleans up the CSRF token on authentication to
95
- # avoid CSRF token fixation attacks. This means that, when using AJAX
96
- # requests for sign in and sign up, you need to get a new CSRF token
97
- # from the server. You can disable this option at your own risk.
98
- # config.clean_up_csrf_token_on_authentication = true
99
-
100
- # When false, Devise will not attempt to reload routes on eager load.
101
- # This can reduce the time taken to boot the app but if your application
102
- # requires the Devise mappings to be loaded during boot time the application
103
- # won't boot properly.
104
- # config.reload_routes = true
105
-
106
- # ==> Configuration for :database_authenticatable
107
- # For bcrypt, this is the cost for hashing the password and defaults to 11. If
108
- # using other algorithms, it sets how many times you want the password to be hashed.
109
- #
110
- # Limiting the stretches to just one in testing will increase the performance of
111
- # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
112
- # a value less than 10 in other environments. Note that, for bcrypt (the default
113
- # algorithm), the cost increases exponentially with the number of stretches (e.g.
114
- # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
115
- config.stretches = Rails.env.test? ? 1 : 11
116
-
117
- # Set up a pepper to generate the hashed password.
118
- # config.pepper = '8cb8115e84ce11219f028bd27b1a98ab5802a37cd0ab7e54b92ba74e64370b4a415602cc933e7215128faa952c4a7c5ff813d9ff83a3f8bea5d01c23c1f70f64'
119
-
120
- # Send a notification to the original email when the user's email is changed.
121
- # config.send_email_changed_notification = false
122
-
123
- # Send a notification email when the user's password is changed.
124
- # config.send_password_change_notification = false
125
-
126
- # ==> Configuration for :confirmable
127
- # A period that the user is allowed to access the website even without
128
- # confirming their account. For instance, if set to 2.days, the user will be
129
- # able to access the website for two days without confirming their account,
130
- # access will be blocked just in the third day.
131
- # You can also set it to nil, which will allow the user to access the website
132
- # without confirming their account.
133
- # Default is 0.days, meaning the user cannot access the website without
134
- # confirming their account.
135
- # config.allow_unconfirmed_access_for = 2.days
136
-
137
- # A period that the user is allowed to confirm their account before their
138
- # token becomes invalid. For example, if set to 3.days, the user can confirm
139
- # their account within 3 days after the mail was sent, but on the fourth day
140
- # their account can't be confirmed with the token any more.
141
- # Default is nil, meaning there is no restriction on how long a user can take
142
- # before confirming their account.
143
- # config.confirm_within = 3.days
144
-
145
- # If true, requires any email changes to be confirmed (exactly the same way as
146
- # initial account confirmation) to be applied. Requires additional unconfirmed_email
147
- # db field (see migrations). Until confirmed, new email is stored in
148
- # unconfirmed_email column, and copied to email column on successful confirmation.
149
- config.reconfirmable = true
150
-
151
- # Defines which key will be used when confirming an account
152
- # config.confirmation_keys = [:email]
153
-
154
- # ==> Configuration for :rememberable
155
- # The time the user will be remembered without asking for credentials again.
156
- # config.remember_for = 2.weeks
157
-
158
- # Invalidates all the remember me tokens when the user signs out.
159
- config.expire_all_remember_me_on_sign_out = true
160
-
161
- # If true, extends the user's remember period when remembered via cookie.
162
- # config.extend_remember_period = false
163
-
164
- # Options to be passed to the created cookie. For instance, you can set
165
- # secure: true in order to force SSL only cookies.
166
- # config.rememberable_options = {}
167
-
168
- # ==> Configuration for :validatable
169
- # Range for password length.
170
- config.password_length = 6..128
171
-
172
- # Email regex used to validate email formats. It simply asserts that
173
- # one (and only one) @ exists in the given string. This is mainly
174
- # to give user feedback and not to assert the e-mail validity.
175
- config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
176
-
177
- # ==> Configuration for :timeoutable
178
- # The time you want to timeout the user session without activity. After this
179
- # time the user will be asked for credentials again. Default is 30 minutes.
180
- # config.timeout_in = 30.minutes
181
-
182
- # ==> Configuration for :lockable
183
- # Defines which strategy will be used to lock an account.
184
- # :failed_attempts = Locks an account after a number of failed attempts to sign in.
185
- # :none = No lock strategy. You should handle locking by yourself.
186
- # config.lock_strategy = :failed_attempts
187
-
188
- # Defines which key will be used when locking and unlocking an account
189
- # config.unlock_keys = [:email]
190
-
191
- # Defines which strategy will be used to unlock an account.
192
- # :email = Sends an unlock link to the user email
193
- # :time = Re-enables login after a certain amount of time (see :unlock_in below)
194
- # :both = Enables both strategies
195
- # :none = No unlock strategy. You should handle unlocking by yourself.
196
- # config.unlock_strategy = :both
197
-
198
- # Number of authentication tries before locking an account if lock_strategy
199
- # is failed attempts.
200
- # config.maximum_attempts = 20
201
-
202
- # Time interval to unlock the account if :time is enabled as unlock_strategy.
203
- # config.unlock_in = 1.hour
204
-
205
- # Warn on the last attempt before the account is locked.
206
- # config.last_attempt_warning = true
207
-
208
- # ==> Configuration for :recoverable
209
- #
210
- # Defines which key will be used when recovering the password for an account
211
- # config.reset_password_keys = [:email]
212
-
213
- # Time interval you can reset your password with a reset password key.
214
- # Don't put a too small interval or your users won't have the time to
215
- # change their passwords.
216
- config.reset_password_within = 6.hours
217
-
218
- # When set to false, does not sign a user in automatically after their password is
219
- # reset. Defaults to true, so a user is signed in automatically after a reset.
220
- # config.sign_in_after_reset_password = true
221
-
222
- # ==> Configuration for :encryptable
223
- # Allow you to use another hashing or encryption algorithm besides bcrypt (default).
224
- # You can use :sha1, :sha512 or algorithms from others authentication tools as
225
- # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
226
- # for default behavior) and :restful_authentication_sha1 (then you should set
227
- # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
228
- #
229
- # Require the `devise-encryptable` gem when using anything other than bcrypt
230
- # config.encryptor = :sha512
231
-
232
- # ==> Scopes configuration
233
- # Turn scoped views on. Before rendering "sessions/new", it will first check for
234
- # "users/sessions/new". It's turned off by default because it's slower if you
235
- # are using only default views.
236
- config.scoped_views = true
237
-
238
- # Configure the default scope given to Warden. By default it's the first
239
- # devise role declared in your routes (usually :user).
240
- config.default_scope = :user
241
-
242
- # Set this configuration to false if you want /users/sign_out to sign out
243
- # only the current scope. By default, Devise signs out all scopes.
244
- config.sign_out_all_scopes = true
245
-
246
- # ==> Navigation configuration
247
- # Lists the formats that should be treated as navigational. Formats like
248
- # :html, should redirect to the sign in page when the user does not have
249
- # access, but formats like :xml or :json, should return 401.
250
- #
251
- # If you have any extra navigational formats, like :iphone or :mobile, you
252
- # should add them to the navigational formats lists.
253
- #
254
- # The "*/*" below is required to match Internet Explorer requests.
255
- # config.navigational_formats = ['*/*', :html]
256
-
257
- # The default HTTP method used to sign out a resource. Default is :delete.
258
- config.sign_out_via = :delete
259
-
260
- # ==> OmniAuth
261
- # Add a new OmniAuth provider. Check the wiki for more information on setting
262
- # up on your models and hooks.
263
- # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
264
-
265
- # ==> Warden configuration
266
- # If you want to use other strategies, that are not supported by Devise, or
267
- # change the failure app, you can configure them inside the config.warden block.
268
- #
269
- # config.warden do |manager|
270
- # manager.intercept_401 = false
271
- # manager.default_strategies(scope: :user).unshift :some_external_strategy
272
- # end
273
-
274
- # ==> Mountable engine configurations
275
- # When using Devise inside an engine, let's call it `MyEngine`, and this engine
276
- # is mountable, there are some extra configurations to be taken into account.
277
- # The following options are available, assuming the engine is mounted as:
278
- #
279
- # mount MyEngine, at: '/my_engine'
280
- #
281
- # The router that invoked `devise_for`, in the example above, would be:
282
- config.router_name = :phcdevworks_accounts
283
- #
284
- # When using OmniAuth, Devise cannot automatically set OmniAuth path,
285
- # so you need to do it manually. For the users scope, it would be:
286
- # config.omniauth_path_prefix = '/my_engine/users/auth'
287
-
288
- # ==> Turbolinks configuration
289
- # If your app is using Turbolinks, Turbolinks::Controller needs to be included to make redirection work correctly:
290
- #
291
- # ActiveSupport.on_load(:devise_failure_app) do
292
- # include Turbolinks::Controller
293
- # end
294
-
295
- # ==> Configuration for :registerable
296
-
297
- # When set to false, does not sign a user in automatically after their password is
298
- # changed. Defaults to true, so a user is signed in automatically after changing a password.
299
- # config.sign_in_after_change_password = true
300
-
301
- # Change Layouts According to Controller
302
- Rails.application.config.to_prepare do
303
- Devise::SessionsController.layout "phcdevworks_accounts/devise"
304
- Devise::RegistrationsController.layout proc{ |controller| user_signed_in? ? "phcdevworks_accounts/application" : "phcdevworks_accounts/devise" }
305
- Devise::ConfirmationsController.layout "phcdevworks_accounts/application_no_sidebar"
306
- Devise::UnlocksController.layout "phcdevworks_accounts/application_no_sidebar"
307
- Devise::PasswordsController.layout "phcdevworks_accounts/application_no_sidebar"
308
- end
309
-
310
- end
1
+ # frozen_string_literal: true
2
+
3
+ # Use this hook to configure devise mailer, warden hooks and so forth.
4
+ # Many of these configuration options can be set straight in your model.
5
+ Devise.setup do |config|
6
+
7
+ # The secret key used by Devise. Devise uses this key to generate
8
+ # random tokens. Changing this key will render invalid all existing
9
+ # confirmation, reset password and unlock tokens in the database.
10
+ # Devise will use the `secret_key_base` as its `secret_key`
11
+ # by default. You can change it below and use your own secret key.
12
+ config.secret_key = ENV['SECRET_KEY_BASE'] if Rails.env.production?
13
+
14
+ # ==> Controller configuration
15
+ # Configure the parent class to the devise controllers.
16
+ config.parent_controller = 'PhcdevworksAccounts::ApplicationController'
17
+
18
+ # ==> Mailer Configuration
19
+ # Configure the e-mail address which will be shown in Devise::Mailer,
20
+ # note that it will be overwritten if you use your own mailer class
21
+ # with default "from" parameter.
22
+ config.mailer_sender = ENV['PHCDEV_EMAIL_SENDER']
23
+
24
+ # Configure the class responsible to send e-mails.
25
+ # config.mailer = 'Devise::Mailer'
26
+
27
+ # Configure the parent class responsible to send e-mails.
28
+ # config.parent_mailer = 'ActionMailer::Base'
29
+
30
+ # ==> ORM configuration
31
+ # Load and configure the ORM. Supports :active_record (default) and
32
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
33
+ # available as additional gems.
34
+ require 'devise/orm/active_record'
35
+
36
+ # ==> Configuration for any authentication mechanism
37
+ # Configure which keys are used when authenticating a user. The default is
38
+ # just :email. You can configure it to use [:username, :subdomain], so for
39
+ # authenticating a user, both parameters are required. Remember that those
40
+ # parameters are used only when authenticating and not when retrieving from
41
+ # session. If you need permissions, you should implement that in a before filter.
42
+ # You can also supply a hash where the value is a boolean determining whether
43
+ # or not authentication should be aborted when the value is not present.
44
+ # config.authentication_keys = [:email]
45
+
46
+ # Configure parameters from the request object used for authentication. Each entry
47
+ # given should be a request method and it will automatically be passed to the
48
+ # find_for_authentication method and considered in your model lookup. For instance,
49
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
50
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
51
+ # config.request_keys = []
52
+
53
+ # Configure which authentication keys should be case-insensitive.
54
+ # These keys will be downcased upon creating or modifying a user and when used
55
+ # to authenticate or find a user. Default is :email.
56
+ config.case_insensitive_keys = [:email]
57
+
58
+ # Configure which authentication keys should have whitespace stripped.
59
+ # These keys will have whitespace before and after removed upon creating or
60
+ # modifying a user and when used to authenticate or find a user. Default is :email.
61
+ config.strip_whitespace_keys = [:email]
62
+
63
+ # Tell if authentication through request.params is enabled. True by default.
64
+ # It can be set to an array that will enable params authentication only for the
65
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
66
+ # enable it only for database (email + password) authentication.
67
+ # config.params_authenticatable = true
68
+
69
+ # Tell if authentication through HTTP Auth is enabled. False by default.
70
+ # It can be set to an array that will enable http authentication only for the
71
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
72
+ # enable it only for database authentication. The supported strategies are:
73
+ # :database = Support basic authentication with authentication key + password
74
+ # config.http_authenticatable = false
75
+
76
+ # If 401 status code should be returned for AJAX requests. True by default.
77
+ # config.http_authenticatable_on_xhr = true
78
+
79
+ # The realm used in Http Basic Authentication. 'Application' by default.
80
+ # config.http_authentication_realm = 'Application'
81
+
82
+ # It will change confirmation, password recovery and other workflows
83
+ # to behave the same regardless if the e-mail provided was right or wrong.
84
+ # Does not affect registerable.
85
+ # config.paranoid = true
86
+
87
+ # By default Devise will store the user in session. You can skip storage for
88
+ # particular strategies by setting this option.
89
+ # Notice that if you are skipping storage for all authentication paths, you
90
+ # may want to disable generating routes to Devise's sessions controller by
91
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
92
+ config.skip_session_storage = [:http_auth]
93
+
94
+ # By default, Devise cleans up the CSRF token on authentication to
95
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
96
+ # requests for sign in and sign up, you need to get a new CSRF token
97
+ # from the server. You can disable this option at your own risk.
98
+ # config.clean_up_csrf_token_on_authentication = true
99
+
100
+ # When false, Devise will not attempt to reload routes on eager load.
101
+ # This can reduce the time taken to boot the app but if your application
102
+ # requires the Devise mappings to be loaded during boot time the application
103
+ # won't boot properly.
104
+ # config.reload_routes = true
105
+
106
+ # ==> Configuration for :database_authenticatable
107
+ # For bcrypt, this is the cost for hashing the password and defaults to 11. If
108
+ # using other algorithms, it sets how many times you want the password to be hashed.
109
+ #
110
+ # Limiting the stretches to just one in testing will increase the performance of
111
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
112
+ # a value less than 10 in other environments. Note that, for bcrypt (the default
113
+ # algorithm), the cost increases exponentially with the number of stretches (e.g.
114
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
115
+ config.stretches = Rails.env.test? ? 1 : 11
116
+
117
+ # Set up a pepper to generate the hashed password.
118
+ # config.pepper = '8cb8115e84ce11219f028bd27b1a98ab5802a37cd0ab7e54b92ba74e64370b4a415602cc933e7215128faa952c4a7c5ff813d9ff83a3f8bea5d01c23c1f70f64'
119
+
120
+ # Send a notification to the original email when the user's email is changed.
121
+ # config.send_email_changed_notification = false
122
+
123
+ # Send a notification email when the user's password is changed.
124
+ # config.send_password_change_notification = false
125
+
126
+ # ==> Configuration for :confirmable
127
+ # A period that the user is allowed to access the website even without
128
+ # confirming their account. For instance, if set to 2.days, the user will be
129
+ # able to access the website for two days without confirming their account,
130
+ # access will be blocked just in the third day.
131
+ # You can also set it to nil, which will allow the user to access the website
132
+ # without confirming their account.
133
+ # Default is 0.days, meaning the user cannot access the website without
134
+ # confirming their account.
135
+ # config.allow_unconfirmed_access_for = 2.days
136
+
137
+ # A period that the user is allowed to confirm their account before their
138
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
139
+ # their account within 3 days after the mail was sent, but on the fourth day
140
+ # their account can't be confirmed with the token any more.
141
+ # Default is nil, meaning there is no restriction on how long a user can take
142
+ # before confirming their account.
143
+ # config.confirm_within = 3.days
144
+
145
+ # If true, requires any email changes to be confirmed (exactly the same way as
146
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
147
+ # db field (see migrations). Until confirmed, new email is stored in
148
+ # unconfirmed_email column, and copied to email column on successful confirmation.
149
+ config.reconfirmable = true
150
+
151
+ # Defines which key will be used when confirming an account
152
+ # config.confirmation_keys = [:email]
153
+
154
+ # ==> Configuration for :rememberable
155
+ # The time the user will be remembered without asking for credentials again.
156
+ # config.remember_for = 2.weeks
157
+
158
+ # Invalidates all the remember me tokens when the user signs out.
159
+ config.expire_all_remember_me_on_sign_out = true
160
+
161
+ # If true, extends the user's remember period when remembered via cookie.
162
+ # config.extend_remember_period = false
163
+
164
+ # Options to be passed to the created cookie. For instance, you can set
165
+ # secure: true in order to force SSL only cookies.
166
+ # config.rememberable_options = {}
167
+
168
+ # ==> Configuration for :validatable
169
+ # Range for password length.
170
+ config.password_length = 6..128
171
+
172
+ # Email regex used to validate email formats. It simply asserts that
173
+ # one (and only one) @ exists in the given string. This is mainly
174
+ # to give user feedback and not to assert the e-mail validity.
175
+ config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
176
+
177
+ # ==> Configuration for :timeoutable
178
+ # The time you want to timeout the user session without activity. After this
179
+ # time the user will be asked for credentials again. Default is 30 minutes.
180
+ # config.timeout_in = 30.minutes
181
+
182
+ # ==> Configuration for :lockable
183
+ # Defines which strategy will be used to lock an account.
184
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
185
+ # :none = No lock strategy. You should handle locking by yourself.
186
+ # config.lock_strategy = :failed_attempts
187
+
188
+ # Defines which key will be used when locking and unlocking an account
189
+ # config.unlock_keys = [:email]
190
+
191
+ # Defines which strategy will be used to unlock an account.
192
+ # :email = Sends an unlock link to the user email
193
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
194
+ # :both = Enables both strategies
195
+ # :none = No unlock strategy. You should handle unlocking by yourself.
196
+ # config.unlock_strategy = :both
197
+
198
+ # Number of authentication tries before locking an account if lock_strategy
199
+ # is failed attempts.
200
+ # config.maximum_attempts = 20
201
+
202
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
203
+ # config.unlock_in = 1.hour
204
+
205
+ # Warn on the last attempt before the account is locked.
206
+ # config.last_attempt_warning = true
207
+
208
+ # ==> Configuration for :recoverable
209
+ #
210
+ # Defines which key will be used when recovering the password for an account
211
+ # config.reset_password_keys = [:email]
212
+
213
+ # Time interval you can reset your password with a reset password key.
214
+ # Don't put a too small interval or your users won't have the time to
215
+ # change their passwords.
216
+ config.reset_password_within = 6.hours
217
+
218
+ # When set to false, does not sign a user in automatically after their password is
219
+ # reset. Defaults to true, so a user is signed in automatically after a reset.
220
+ # config.sign_in_after_reset_password = true
221
+
222
+ # ==> Configuration for :encryptable
223
+ # Allow you to use another hashing or encryption algorithm besides bcrypt (default).
224
+ # You can use :sha1, :sha512 or algorithms from others authentication tools as
225
+ # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
226
+ # for default behavior) and :restful_authentication_sha1 (then you should set
227
+ # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
228
+ #
229
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
230
+ # config.encryptor = :sha512
231
+
232
+ # ==> Scopes configuration
233
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
234
+ # "users/sessions/new". It's turned off by default because it's slower if you
235
+ # are using only default views.
236
+ config.scoped_views = true
237
+
238
+ # Configure the default scope given to Warden. By default it's the first
239
+ # devise role declared in your routes (usually :user).
240
+ config.default_scope = :user
241
+
242
+ # Set this configuration to false if you want /users/sign_out to sign out
243
+ # only the current scope. By default, Devise signs out all scopes.
244
+ config.sign_out_all_scopes = true
245
+
246
+ # ==> Navigation configuration
247
+ # Lists the formats that should be treated as navigational. Formats like
248
+ # :html, should redirect to the sign in page when the user does not have
249
+ # access, but formats like :xml or :json, should return 401.
250
+ #
251
+ # If you have any extra navigational formats, like :iphone or :mobile, you
252
+ # should add them to the navigational formats lists.
253
+ #
254
+ # The "*/*" below is required to match Internet Explorer requests.
255
+ # config.navigational_formats = ['*/*', :html]
256
+
257
+ # The default HTTP method used to sign out a resource. Default is :delete.
258
+ config.sign_out_via = :delete
259
+
260
+ # ==> OmniAuth
261
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
262
+ # up on your models and hooks.
263
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
264
+
265
+ # ==> Warden configuration
266
+ # If you want to use other strategies, that are not supported by Devise, or
267
+ # change the failure app, you can configure them inside the config.warden block.
268
+ #
269
+ # config.warden do |manager|
270
+ # manager.intercept_401 = false
271
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
272
+ # end
273
+
274
+ # ==> Mountable engine configurations
275
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
276
+ # is mountable, there are some extra configurations to be taken into account.
277
+ # The following options are available, assuming the engine is mounted as:
278
+ #
279
+ # mount MyEngine, at: '/my_engine'
280
+ #
281
+ # The router that invoked `devise_for`, in the example above, would be:
282
+ config.router_name = :phcdevworks_accounts
283
+ #
284
+ # When using OmniAuth, Devise cannot automatically set OmniAuth path,
285
+ # so you need to do it manually. For the users scope, it would be:
286
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
287
+
288
+ # ==> Turbolinks configuration
289
+ # If your app is using Turbolinks, Turbolinks::Controller needs to be included to make redirection work correctly:
290
+ #
291
+ # ActiveSupport.on_load(:devise_failure_app) do
292
+ # include Turbolinks::Controller
293
+ # end
294
+
295
+ # ==> Configuration for :registerable
296
+
297
+ # When set to false, does not sign a user in automatically after their password is
298
+ # changed. Defaults to true, so a user is signed in automatically after changing a password.
299
+ # config.sign_in_after_change_password = true
300
+
301
+ # Change Layouts According to Controller
302
+ Rails.application.config.to_prepare do
303
+ Devise::SessionsController.layout "phcdevworks_accounts/devise"
304
+ Devise::RegistrationsController.layout proc{ |controller| user_signed_in? ? "phcdevworks_accounts/application" : "phcdevworks_accounts/devise" }
305
+ Devise::ConfirmationsController.layout "phcdevworks_accounts/application_no_sidebar"
306
+ Devise::UnlocksController.layout "phcdevworks_accounts/application_no_sidebar"
307
+ Devise::PasswordsController.layout "phcdevworks_accounts/application_no_sidebar"
308
+ end
309
+
310
+ end