sorcery 0.13.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sorcery might be problematic. Click here for more details.

Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +0 -26
  3. data/CHANGELOG.md +13 -0
  4. data/Gemfile +1 -1
  5. data/README.md +2 -1
  6. data/lib/generators/sorcery/templates/initializer.rb +85 -85
  7. data/lib/generators/sorcery/templates/migration/activity_logging.rb +4 -4
  8. data/lib/generators/sorcery/templates/migration/brute_force_protection.rb +3 -3
  9. data/lib/generators/sorcery/templates/migration/core.rb +2 -2
  10. data/lib/generators/sorcery/templates/migration/external.rb +3 -3
  11. data/lib/generators/sorcery/templates/migration/magic_login.rb +3 -3
  12. data/lib/generators/sorcery/templates/migration/remember_me.rb +2 -2
  13. data/lib/generators/sorcery/templates/migration/reset_password.rb +4 -4
  14. data/lib/generators/sorcery/templates/migration/user_activation.rb +3 -3
  15. data/lib/sorcery/controller/submodules/activity_logging.rb +10 -3
  16. data/lib/sorcery/controller/submodules/brute_force_protection.rb +7 -3
  17. data/lib/sorcery/controller/submodules/external.rb +1 -0
  18. data/lib/sorcery/controller/submodules/http_basic_auth.rb +4 -1
  19. data/lib/sorcery/controller/submodules/remember_me.rb +7 -2
  20. data/lib/sorcery/controller/submodules/session_timeout.rb +7 -2
  21. data/lib/sorcery/crypto_providers/aes256.rb +1 -1
  22. data/lib/sorcery/crypto_providers/bcrypt.rb +6 -1
  23. data/lib/sorcery/model.rb +1 -0
  24. data/lib/sorcery/model/config.rb +5 -0
  25. data/lib/sorcery/model/submodules/magic_login.rb +7 -4
  26. data/lib/sorcery/model/submodules/reset_password.rb +6 -2
  27. data/lib/sorcery/providers/line.rb +47 -0
  28. data/lib/sorcery/providers/linkedin.rb +20 -36
  29. data/lib/sorcery/version.rb +1 -1
  30. data/spec/controllers/controller_oauth2_spec.rb +8 -0
  31. data/spec/rails_app/app/controllers/sorcery_controller.rb +20 -0
  32. data/spec/rails_app/config/routes.rb +3 -0
  33. data/spec/shared_examples/user_reset_password_shared_examples.rb +18 -2
  34. data/spec/shared_examples/user_shared_examples.rb +63 -0
  35. data/spec/sorcery_crypto_providers_spec.rb +60 -0
  36. metadata +3 -5
  37. data/gemfiles/active_record_rails_40.gemfile +0 -6
  38. data/gemfiles/active_record_rails_41.gemfile +0 -6
  39. data/gemfiles/active_record_rails_42.gemfile +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e5daa6548cc9fd5cdc73cf219dd6b2cecc9aa9de783f7544823d1243fd070ee
4
- data.tar.gz: 0162cca06bf333177fd47386827ebb578571f91edc0a5600ab80ab12f537a771
3
+ metadata.gz: bfe20ba10b3d52ae3bd1c37f487d5a3e42da98387127033d26978831f523e4a1
4
+ data.tar.gz: 5a3f0f7279d060ce1515e8635d9f87c5c52a840d6c15916e064171714b1d26a5
5
5
  SHA512:
6
- metadata.gz: 509919dd3b6cef24468ef57a49adef3fad0c8437d525ff40e0fc6f953e887d4b152a53912900dc7054bf6698b09d1ba6a6d968bd55ccc2764264201833fe4527
7
- data.tar.gz: d91c9f6528d7c8cdd019028a537a02e6838135c3be793116667ff152274915b08e64f0da1fbac14747207db1e7836dd496cce9c2735b68433ccc08c3d1d9b3e5
6
+ metadata.gz: a1ff57ddfbfebe031dab7bc2d21bab6a045d48cc03f9b5b1cc50786ce6eb541a89e799d8dc6d68cf4b9995aa89409f101166cc8f0c8aa17056daad4af6bba502
7
+ data.tar.gz: 8d3eae6eb8a66f9e93ae312f4e9300587bdea66e6800b3608bcfe87e5c2f437e2af85ccc865575471f27c011a7ba947f80836f880bf00d21229bbb6ccdc3e42f
data/.travis.yml CHANGED
@@ -7,32 +7,6 @@ rvm:
7
7
 
8
8
  gemfile:
9
9
  - Gemfile
10
- - gemfiles/active_record_rails_40.gemfile
11
- - gemfiles/active_record_rails_41.gemfile
12
- - gemfiles/active_record_rails_42.gemfile
13
10
 
14
11
  before_script:
15
12
  - mysql -e 'create database sorcery_test;'
16
-
17
- before_install:
18
- - rvm get stable --auto-dotfiles
19
- - gem update bundler
20
-
21
- matrix:
22
- exclude:
23
- - rvm: 2.2.9
24
- gemfile: gemfiles/active_record_rails_40.gemfile
25
- - rvm: 2.3.6
26
- gemfile: gemfiles/active_record_rails_40.gemfile
27
- - rvm: 2.4.3
28
- gemfile: gemfiles/active_record_rails_40.gemfile
29
- - rvm: 2.4.3
30
- gemfile: gemfiles/active_record_rails_41.gemfile
31
- - rvm: 2.4.3
32
- gemfile: gemfiles/active_record_rails_42.gemfile
33
- - rvm: 2.5.0
34
- gemfile: gemfiles/active_record_rails_40.gemfile
35
- - rvm: 2.5.0
36
- gemfile: gemfiles/active_record_rails_41.gemfile
37
- - rvm: 2.5.0
38
- gemfile: gemfiles/active_record_rails_42.gemfile
data/CHANGELOG.md CHANGED
@@ -1,6 +1,19 @@
1
1
  # Changelog
2
2
  ## HEAD
3
3
 
4
+ ## 0.14.0
5
+
6
+ * Update LinkedIn to use OAuth 2 [#189](https://github.com/Sorcery/sorcery/pull/189)
7
+ * Support the LINE login auth [#80](https://github.com/Sorcery/sorcery/pull/80)
8
+ * Allow BCrypt to have app-specific secret token [#173](https://github.com/Sorcery/sorcery/pull/173)
9
+ * Add #change_password method to reset_password module. [#165](https://github.com/Sorcery/sorcery/pull/165)
10
+ * Clean up initializer comments [#153](https://github.com/Sorcery/sorcery/pull/153)
11
+ * Allow load_from_magic_login_token to accept a block [#152](https://github.com/Sorcery/sorcery/pull/152)
12
+ * Fix CipherError class name [#142](https://github.com/Sorcery/sorcery/pull/142)
13
+ * Fix `update_failed_logins_count` being called twice when login failed [#163](https://github.com/Sorcery/sorcery/pull/163)
14
+ * Update migration templates to use new hash syntax [#170](https://github.com/Sorcery/sorcery/pull/170)
15
+ * Support for Rails 4.2 and lower soft-dropped [#171](https://github.com/Sorcery/sorcery/pull/171)
16
+
4
17
  ## 0.13.0
5
18
 
6
19
  * Add support for Rails 5.2 / Ruby 2.5 [#129](https://github.com/Sorcery/sorcery/pull/129)
data/Gemfile CHANGED
@@ -3,6 +3,6 @@ source 'https://rubygems.org'
3
3
  gem 'pry'
4
4
  gem 'rails', '~> 5.2.0'
5
5
  gem 'rails-controller-testing'
6
- gem 'sqlite3'
6
+ gem 'sqlite3', '~> 1.3.6'
7
7
 
8
8
  gemspec
data/README.md CHANGED
@@ -99,7 +99,8 @@ force_forget_me! # Forgets all sessions by clearing the token, even if remember_
99
99
  User.load_from_reset_password_token(token)
100
100
  @user.generate_reset_password_token! # Use if you want to send the email by yourself
101
101
  @user.deliver_reset_password_instructions! # Generates the token and sends the email
102
- @user.change_password!(new_password)
102
+ @user.change_password(new_password)
103
+ @user.change_password!(new_password) # Same as change_password but raises exception on save
103
104
  ```
104
105
 
105
106
  ### Session Timeout
@@ -1,7 +1,9 @@
1
1
  # The first thing you need to configure is which modules you need in your app.
2
2
  # The default is nothing which will include only core features (password encryption, login/logout).
3
+ #
3
4
  # Available submodules are: :user_activation, :http_basic_auth, :remember_me,
4
- # :reset_password, :session_timeout, :brute_force_protection, :activity_logging, :external
5
+ # :reset_password, :session_timeout, :brute_force_protection, :activity_logging,
6
+ # :magic_login, :external
5
7
  Rails.application.config.sorcery.submodules = []
6
8
 
7
9
  # Here you can configure each submodule's features.
@@ -13,8 +15,8 @@ Rails.application.config.sorcery.configure do |config|
13
15
  #
14
16
  # config.not_authenticated_action =
15
17
 
16
- # When a non logged in user tries to enter a page that requires login, save
17
- # the URL he wanted to reach, and send him there after login, using 'redirect_back_or_to'.
18
+ # When a non logged-in user tries to enter a page that requires login, save
19
+ # the URL he wants to reach, and send him there after login, using 'redirect_back_or_to'.
18
20
  # Default: `true`
19
21
  #
20
22
  # config.save_return_to_url =
@@ -46,7 +48,7 @@ Rails.application.config.sorcery.configure do |config|
46
48
  #
47
49
  # config.session_timeout_from_last_action =
48
50
 
49
- # Invalidate active sessions Requires an `invalidate_sessions_before` timestamp column
51
+ # Invalidate active sessions. Requires an `invalidate_sessions_before` timestamp column
50
52
  # Default: `false`
51
53
  #
52
54
  # config.session_timeout_invalidate_active_sessions_enabled =
@@ -58,23 +60,24 @@ Rails.application.config.sorcery.configure do |config|
58
60
  # config.controller_to_realm_map =
59
61
 
60
62
  # -- activity logging --
61
- # will register the time of last user login, every login.
63
+ # Will register the time of last user login, every login.
62
64
  # Default: `true`
63
65
  #
64
66
  # config.register_login_time =
65
67
 
66
- # will register the time of last user logout, every logout.
68
+ # Will register the time of last user logout, every logout.
67
69
  # Default: `true`
68
70
  #
69
71
  # config.register_logout_time =
70
72
 
71
- # will register the time of last user action, every action.
73
+ # Will register the time of last user action, every action.
72
74
  # Default: `true`
73
75
  #
74
76
  # config.register_last_activity_time =
75
77
 
76
78
  # -- external --
77
- # What providers are supported by this app, i.e. [:twitter, :facebook, :github, :linkedin, :xing, :google, :liveid, :salesforce, :slack] .
79
+ # What providers are supported by this app
80
+ # i.e. [:twitter, :facebook, :github, :linkedin, :xing, :google, :liveid, :salesforce, :slack, :line].
78
81
  # Default: `[]`
79
82
  #
80
83
  # config.external_providers =
@@ -85,16 +88,11 @@ Rails.application.config.sorcery.configure do |config|
85
88
  #
86
89
  # config.ca_file =
87
90
 
88
- # For information about LinkedIn API:
89
- # - user info fields go to https://developer.linkedin.com/documents/profile-fields
90
- # - access permissions go to https://developer.linkedin.com/documents/authentication#granting
91
- #
92
91
  # config.linkedin.key = ""
93
92
  # config.linkedin.secret = ""
94
93
  # config.linkedin.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=linkedin"
95
- # config.linkedin.user_info_fields = ['first-name', 'last-name']
96
94
  # config.linkedin.user_info_mapping = {first_name: "firstName", last_name: "lastName"}
97
- # config.linkedin.access_permissions = ['r_basicprofile']
95
+ # config.linkedin.scope = "r_basicprofile"
98
96
  #
99
97
  #
100
98
  # For information about XING API:
@@ -107,7 +105,7 @@ Rails.application.config.sorcery.configure do |config|
107
105
  #
108
106
  #
109
107
  # Twitter will not accept any requests nor redirect uri containing localhost,
110
- # make sure you use 0.0.0.0:3000 to access your app in development
108
+ # Make sure you use 0.0.0.0:3000 to access your app in development
111
109
  #
112
110
  # config.twitter.key = ""
113
111
  # config.twitter.secret = ""
@@ -159,7 +157,8 @@ Rails.application.config.sorcery.configure do |config|
159
157
  # config.google.scope = "https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
160
158
  #
161
159
  # For Microsoft Graph, the key will be your App ID, and the secret will be your app password/public key.
162
- # The callback URL "can't contain a query string or invalid special characters", see: https://docs.microsoft.com/en-us/azure/active-directory/active-directory-v2-limitations#restrictions-on-redirect-uris
160
+ # The callback URL "can't contain a query string or invalid special characters"
161
+ # See: https://docs.microsoft.com/en-us/azure/active-directory/active-directory-v2-limitations#restrictions-on-redirect-uris
163
162
  # More information at https://graph.microsoft.io/en-us/docs
164
163
  #
165
164
  # config.microsoft.key = ""
@@ -190,7 +189,7 @@ Rails.application.config.sorcery.configure do |config|
190
189
 
191
190
  # For information about JIRA API:
192
191
  # https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+OAuth+authentication
193
- # to obtain the consumer key and the public key you can use the jira-ruby gem https://github.com/sumoheavy/jira-ruby
192
+ # To obtain the consumer key and the public key you can use the jira-ruby gem https://github.com/sumoheavy/jira-ruby
194
193
  # or run openssl req -x509 -nodes -newkey rsa:1024 -sha1 -keyout rsakey.pem -out rsacert.pem to obtain the public key
195
194
  # Make sure you have configured the application link properly
196
195
 
@@ -203,7 +202,7 @@ Rails.application.config.sorcery.configure do |config|
203
202
  # For information about Salesforce API:
204
203
  # https://developer.salesforce.com/signup &
205
204
  # https://www.salesforce.com/us/developer/docs/api_rest/
206
- # Salesforce callback_url must be https. You can run the following to generate self-signed ssl cert
205
+ # Salesforce callback_url must be https. You can run the following to generate self-signed ssl cert:
207
206
  # openssl req -new -newkey rsa:2048 -sha1 -days 365 -nodes -x509 -keyout server.key -out server.crt
208
207
  # Make sure you have configured the application link properly
209
208
  # config.salesforce.key = '123123'
@@ -212,230 +211,230 @@ Rails.application.config.sorcery.configure do |config|
212
211
  # config.salesforce.scope = "full"
213
212
  # config.salesforce.user_info_mapping = {:email => "email"}
214
213
 
214
+ # config.line.key = ""
215
+ # config.line.secret = ""
216
+ # config.line.callback_url = "http://mydomain.com:3000/oauth/callback?provider=line"
217
+
215
218
  # --- user config ---
216
219
  config.user_config do |user|
217
220
  # -- core --
218
- # specify username attributes, for example: [:username, :email].
221
+ # Specify username attributes, for example: [:username, :email].
219
222
  # Default: `[:email]`
220
223
  #
221
224
  # user.username_attribute_names =
222
225
 
223
- # change *virtual* password attribute, the one which is used until an encrypted one is generated.
226
+ # Change *virtual* password attribute, the one which is used until an encrypted one is generated.
224
227
  # Default: `:password`
225
228
  #
226
229
  # user.password_attribute_name =
227
230
 
228
- # downcase the username before trying to authenticate, default is false
231
+ # Downcase the username before trying to authenticate, default is false
229
232
  # Default: `false`
230
233
  #
231
234
  # user.downcase_username_before_authenticating =
232
235
 
233
- # change default email attribute.
236
+ # Change default email attribute.
234
237
  # Default: `:email`
235
238
  #
236
239
  # user.email_attribute_name =
237
240
 
238
- # change default crypted_password attribute.
241
+ # Change default crypted_password attribute.
239
242
  # Default: `:crypted_password`
240
243
  #
241
244
  # user.crypted_password_attribute_name =
242
245
 
243
- # what pattern to use to join the password with the salt
246
+ # What pattern to use to join the password with the salt
244
247
  # Default: `""`
245
248
  #
246
249
  # user.salt_join_token =
247
250
 
248
- # change default salt attribute.
251
+ # Change default salt attribute.
249
252
  # Default: `:salt`
250
253
  #
251
254
  # user.salt_attribute_name =
252
255
 
253
- # how many times to apply encryption to the password.
256
+ # How many times to apply encryption to the password.
254
257
  # Default: 1 in test env, `nil` otherwise
255
258
  #
256
259
  user.stretches = 1 if Rails.env.test?
257
260
 
258
- # encryption key used to encrypt reversible encryptions such as AES256.
261
+ # Encryption key used to encrypt reversible encryptions such as AES256.
259
262
  # WARNING: If used for users' passwords, changing this key will leave passwords undecryptable!
260
263
  # Default: `nil`
261
264
  #
262
265
  # user.encryption_key =
263
266
 
264
- # use an external encryption class.
267
+ # Use an external encryption class.
265
268
  # Default: `nil`
266
269
  #
267
270
  # user.custom_encryption_provider =
268
271
 
269
- # encryption algorithm name. See 'encryption_algorithm=' for available options.
272
+ # Encryption algorithm name. See 'encryption_algorithm=' for available options.
270
273
  # Default: `:bcrypt`
271
274
  #
272
275
  # user.encryption_algorithm =
273
276
 
274
- # make this configuration inheritable for subclasses. Useful for ActiveRecord's STI.
277
+ # Make this configuration inheritable for subclasses. Useful for ActiveRecord's STI.
275
278
  # Default: `false`
276
279
  #
277
280
  # user.subclasses_inherit_config =
278
281
 
279
282
  # -- remember_me --
280
283
  # How long in seconds the session length will be
281
- # Default: `604800`
284
+ # Default: `60 * 60 * 24 * 7`
282
285
  #
283
286
  # user.remember_me_for =
284
287
 
285
- # when true sorcery will persist a single remember me token for all
286
- # logins/logouts (supporting remembering on multiple browsers simultaneously).
288
+ # When true, sorcery will persist a single remember me token for all
289
+ # logins/logouts (to support remembering on multiple browsers simultaneously).
287
290
  # Default: false
288
291
  #
289
292
  # user.remember_me_token_persist_globally =
290
293
 
291
294
  # -- user_activation --
292
- # the attribute name to hold activation state (active/pending).
295
+ # The attribute name to hold activation state (active/pending).
293
296
  # Default: `:activation_state`
294
297
  #
295
298
  # user.activation_state_attribute_name =
296
299
 
297
- # the attribute name to hold activation code (sent by email).
300
+ # The attribute name to hold activation code (sent by email).
298
301
  # Default: `:activation_token`
299
302
  #
300
303
  # user.activation_token_attribute_name =
301
304
 
302
- # the attribute name to hold activation code expiration date.
305
+ # The attribute name to hold activation code expiration date.
303
306
  # Default: `:activation_token_expires_at`
304
307
  #
305
308
  # user.activation_token_expires_at_attribute_name =
306
309
 
307
- # how many seconds before the activation code expires. nil for never expires.
310
+ # How many seconds before the activation code expires. nil for never expires.
308
311
  # Default: `nil`
309
312
  #
310
313
  # user.activation_token_expiration_period =
311
314
 
312
- # your mailer class. Required.
315
+ # REQUIRED:
316
+ # User activation mailer class.
313
317
  # Default: `nil`
314
318
  #
315
319
  # user.user_activation_mailer =
316
320
 
317
- # when true sorcery will not automatically
318
- # email activation details and allow you to
319
- # manually handle how and when email is sent.
321
+ # When true, sorcery will not automatically
322
+ # send the activation details email, and allow you to
323
+ # manually handle how and when the email is sent.
320
324
  # Default: `false`
321
325
  #
322
326
  # user.activation_mailer_disabled =
323
327
 
324
- # method to send email related
328
+ # Method to send email related
325
329
  # options: `:deliver_later`, `:deliver_now`, `:deliver`
326
330
  # Default: :deliver (Rails version < 4.2) or :deliver_now (Rails version 4.2+)
327
331
  #
328
332
  # user.email_delivery_method =
329
333
 
330
- # activation needed email method on your mailer class.
334
+ # Activation needed email method on your mailer class.
331
335
  # Default: `:activation_needed_email`
332
336
  #
333
337
  # user.activation_needed_email_method_name =
334
338
 
335
- # activation success email method on your mailer class.
339
+ # Activation success email method on your mailer class.
336
340
  # Default: `:activation_success_email`
337
341
  #
338
342
  # user.activation_success_email_method_name =
339
343
 
340
- # do you want to prevent or allow users that did not activate by email to login?
344
+ # Do you want to prevent users who did not activate by email from logging in?
341
345
  # Default: `true`
342
346
  #
343
347
  # user.prevent_non_active_users_to_login =
344
348
 
345
349
  # -- reset_password --
346
- # reset password code attribute name.
350
+ # Password reset token attribute name.
347
351
  # Default: `:reset_password_token`
348
352
  #
349
353
  # user.reset_password_token_attribute_name =
350
354
 
351
- # expires at attribute name.
355
+ # Password token expiry attribute name.
352
356
  # Default: `:reset_password_token_expires_at`
353
357
  #
354
358
  # user.reset_password_token_expires_at_attribute_name =
355
359
 
356
- # when was email sent, used for hammering protection.
360
+ # When was password reset email sent. Used for hammering protection.
357
361
  # Default: `:reset_password_email_sent_at`
358
362
  #
359
363
  # user.reset_password_email_sent_at_attribute_name =
360
364
 
361
- # mailer class. Needed.
365
+ # REQUIRED:
366
+ # Password reset mailer class.
362
367
  # Default: `nil`
363
368
  #
364
369
  # user.reset_password_mailer =
365
370
 
366
- # reset password email method on your mailer class.
371
+ # Reset password email method on your mailer class.
367
372
  # Default: `:reset_password_email`
368
373
  #
369
374
  # user.reset_password_email_method_name =
370
375
 
371
- # when true sorcery will not automatically
372
- # email password reset details and allow you to
373
- # manually handle how and when email is sent
376
+ # When true, sorcery will not automatically
377
+ # send the password reset details email, and allow you to
378
+ # manually handle how and when the email is sent
374
379
  # Default: `false`
375
380
  #
376
381
  # user.reset_password_mailer_disabled =
377
382
 
378
- # how many seconds before the reset request expires. nil for never expires.
383
+ # How many seconds before the reset request expires. nil for never expires.
379
384
  # Default: `nil`
380
385
  #
381
386
  # user.reset_password_expiration_period =
382
387
 
383
- # hammering protection, how long in seconds to wait before allowing another email to be sent.
388
+ # Hammering protection: how long in seconds to wait before allowing another email to be sent.
384
389
  # Default: `5 * 60`
385
390
  #
386
391
  # user.reset_password_time_between_emails =
387
-
388
- # access counter to a reset password page attribute name
392
+
393
+ # Access counter to a reset password page attribute name
389
394
  # Default: `:access_count_to_reset_password_page`
390
395
  #
391
396
  # user.reset_password_page_access_count_attribute_name =
392
397
 
393
398
  # -- magic_login --
394
- # magic login code attribute name.
399
+ # Magic login code attribute name.
395
400
  # Default: `:magic_login_token`
396
401
  #
397
402
  # user.magic_login_token_attribute_name =
398
403
 
399
-
400
- # expires at attribute name.
404
+ # Magic login expiry attribute name.
401
405
  # Default: `:magic_login_token_expires_at`
402
406
  #
403
407
  # user.magic_login_token_expires_at_attribute_name =
404
408
 
405
-
406
- # when was email sent, used for hammering protection.
409
+ # When was magic login email sent — used for hammering protection.
407
410
  # Default: `:magic_login_email_sent_at`
408
411
  #
409
412
  # user.magic_login_email_sent_at_attribute_name =
410
413
 
411
-
412
- # mailer class. Needed.
414
+ # REQUIRED:
415
+ # Magic login mailer class.
413
416
  # Default: `nil`
414
417
  #
415
418
  # user.magic_login_mailer_class =
416
419
 
417
-
418
- # magic login email method on your mailer class.
420
+ # Magic login email method on your mailer class.
419
421
  # Default: `:magic_login_email`
420
422
  #
421
423
  # user.magic_login_email_method_name =
422
424
 
423
-
424
- # when true sorcery will not automatically
425
- # email magic login details and allow you to
426
- # manually handle how and when email is sent
425
+ # When true, sorcery will not automatically
426
+ # send magic login details email, and allow you to
427
+ # manually handle how and when the email is sent
427
428
  # Default: `true`
428
429
  #
429
430
  # user.magic_login_mailer_disabled =
430
431
 
431
-
432
- # how many seconds before the request expires. nil for never expires.
432
+ # How many seconds before the request expires. nil for never expires.
433
433
  # Default: `nil`
434
434
  #
435
435
  # user.magic_login_expiration_period =
436
436
 
437
-
438
- # hammering protection, how long in seconds to wait before allowing another email to be sent.
437
+ # Hammering protection: how long in seconds to wait before allowing another email to be sent.
439
438
  # Default: `5 * 60`
440
439
  #
441
440
  # user.magic_login_time_between_emails =
@@ -451,12 +450,12 @@ Rails.application.config.sorcery.configure do |config|
451
450
  #
452
451
  # user.lock_expires_at_attribute_name =
453
452
 
454
- # How many failed logins allowed.
453
+ # How many failed logins are allowed.
455
454
  # Default: `50`
456
455
  #
457
456
  # user.consecutive_login_retries_amount_limit =
458
457
 
459
- # How long the user should be banned. in seconds. 0 for permanent.
458
+ # How long the user should be banned, in seconds. 0 for permanent.
460
459
  # Default: `60 * 60`
461
460
  #
462
461
  # user.login_lock_time_period =
@@ -471,16 +470,17 @@ Rails.application.config.sorcery.configure do |config|
471
470
  #
472
471
  # user.unlock_token_email_method_name =
473
472
 
474
- # when true sorcery will not automatically
475
- # send email with unlock token
473
+ # When true, sorcery will not automatically
474
+ # send email with the unlock token
476
475
  # Default: `false`
477
476
  #
478
477
  # user.unlock_token_mailer_disabled = true
479
478
 
480
- # Unlock token mailer class
479
+ # REQUIRED:
480
+ # Unlock token mailer class.
481
481
  # Default: `nil`
482
482
  #
483
- # user.unlock_token_mailer = UserMailer
483
+ # user.unlock_token_mailer =
484
484
 
485
485
  # -- activity logging --
486
486
  # Last login attribute name.
@@ -498,7 +498,7 @@ Rails.application.config.sorcery.configure do |config|
498
498
  #
499
499
  # user.last_activity_at_attribute_name =
500
500
 
501
- # How long since last activity is the user defined logged out?
501
+ # How long since user's last activity will they be considered logged out?
502
502
  # Default: `10 * 60`
503
503
  #
504
504
  # user.activity_timeout =
@@ -509,17 +509,17 @@ Rails.application.config.sorcery.configure do |config|
509
509
  #
510
510
  # user.authentications_class =
511
511
 
512
- # User's identifier in authentications class.
512
+ # User's identifier in the `authentications` class.
513
513
  # Default: `:user_id`
514
514
  #
515
515
  # user.authentications_user_id_attribute_name =
516
516
 
517
- # Provider's identifier in authentications class.
517
+ # Provider's identifier in the `authentications` class.
518
518
  # Default: `:provider`
519
519
  #
520
520
  # user.provider_attribute_name =
521
521
 
522
- # User's external unique identifier in authentications class.
522
+ # User's external unique identifier in the `authentications` class.
523
523
  # Default: `:uid`
524
524
  #
525
525
  # user.provider_uid_attribute_name =
@@ -527,5 +527,5 @@ Rails.application.config.sorcery.configure do |config|
527
527
 
528
528
  # This line must come after the 'user config' block.
529
529
  # Define which model authenticates with sorcery.
530
- config.user_class = '<%= model_class_name %>'
530
+ config.user_class = "<%= model_class_name %>"
531
531
  end