locomotivecms 3.0.0.rc1 → 3.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (176) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +4 -3
  3. data/README.md +7 -1
  4. data/app/api/locomotive/api/entities/content_type_entity.rb +4 -1
  5. data/app/api/locomotive/api/forms/base_form.rb +4 -2
  6. data/app/api/locomotive/api/forms/content_type_form.rb +1 -0
  7. data/app/api/locomotive/api/forms/theme_asset_form.rb +1 -1
  8. data/app/api/locomotive/api/resources/content_type_resource.rb +4 -2
  9. data/app/assets/javascripts/locomotive/views/inputs/array_view.js.coffee +1 -0
  10. data/app/controllers/locomotive/current_site_controller.rb +8 -0
  11. data/app/helpers/locomotive/editable_elements_helper.rb +2 -2
  12. data/app/helpers/locomotive/errors_helper.rb +7 -3
  13. data/app/helpers/locomotive/pages_helper.rb +2 -2
  14. data/app/helpers/locomotive/shared/accounts_helper.rb +1 -1
  15. data/app/inputs/locomotive/api_key_input.rb +2 -2
  16. data/app/mailers/locomotive/notifications.rb +14 -3
  17. data/app/models/locomotive/concerns/content_type/entry_template.rb +7 -1
  18. data/app/models/locomotive/concerns/content_type/public_submission_title_template.rb +24 -0
  19. data/app/models/locomotive/concerns/site/access_points.rb +1 -0
  20. data/app/models/locomotive/concerns/site/url_redirections.rb +30 -0
  21. data/app/models/locomotive/content_entry.rb +9 -1
  22. data/app/models/locomotive/content_type.rb +1 -0
  23. data/app/models/locomotive/page.rb +1 -1
  24. data/app/models/locomotive/site.rb +1 -0
  25. data/app/policies/locomotive/site_policy.rb +4 -3
  26. data/app/uploaders/locomotive/theme_asset_uploader.rb +6 -9
  27. data/app/views/locomotive/content_assets/_list.html.slim +1 -1
  28. data/app/views/locomotive/content_entries/_entry.html.slim +1 -1
  29. data/app/views/locomotive/content_entries/_list.html.slim +1 -1
  30. data/app/views/locomotive/content_entries/edit.html.slim +2 -0
  31. data/app/views/locomotive/content_entries/form/_tabs.html.slim +3 -3
  32. data/app/views/locomotive/content_entries/new.html.slim +3 -0
  33. data/app/views/locomotive/current_site/_membership.html.slim +1 -1
  34. data/app/views/locomotive/current_site/_url_redirection.html.slim +17 -0
  35. data/app/views/locomotive/current_site/form/_access_points.html.slim +2 -0
  36. data/app/views/locomotive/current_site/form/_panes.html.slim +1 -1
  37. data/app/views/locomotive/current_site/form/_tabs.html.slim +3 -0
  38. data/app/views/locomotive/current_site/form/_url_redirections.html.slim +5 -0
  39. data/app/views/locomotive/custom_fields/select_options/_option.html.slim +3 -1
  40. data/app/views/locomotive/editable_elements/index_without_preview.html.slim +3 -3
  41. data/app/views/locomotive/notifications/new_content_entry.html.slim +4 -0
  42. data/app/views/locomotive/pages/form/_actions.html.slim +1 -1
  43. data/app/views/locomotive/pages/form/_tabs.html.slim +3 -3
  44. data/app/views/locomotive/passwords/edit.html.slim +1 -1
  45. data/app/views/locomotive/passwords/new.html.slim +1 -1
  46. data/app/views/locomotive/public_submission_accounts/edit.html.slim +1 -1
  47. data/app/views/locomotive/registrations/new.html.slim +1 -1
  48. data/app/views/locomotive/sessions/new.html.slim +1 -1
  49. data/app/views/locomotive/translations/index.html.slim +2 -1
  50. data/config/i18n-tasks.yml +110 -0
  51. data/config/locales/carrierwave.fr.yml +1 -1
  52. data/config/locales/default.en.yml +0 -49
  53. data/config/locales/default.fr.yml +1 -232
  54. data/config/locales/devise.fr.yml +1 -68
  55. data/config/locales/{admin_ui.en.yml → en.yml} +31 -91
  56. data/config/locales/flash.en.yml +8 -37
  57. data/config/locales/flash.fr.yml +1 -106
  58. data/config/locales/fr.yml +5 -0
  59. data/config/locales/inputs.fr.yml +1 -0
  60. data/config/locales/mongoid.en.yml +49 -0
  61. data/config/locales/mongoid.fr.yml +12 -0
  62. data/config/locales/simple_form.en.yml +26 -65
  63. data/config/locales/simple_form.fr.yml +1 -0
  64. data/config/{locales → old-locales}/admin_ui.bg.yml +0 -0
  65. data/config/{locales → old-locales}/admin_ui.cs.yml +0 -0
  66. data/config/{locales → old-locales}/admin_ui.de.yml +0 -0
  67. data/config/{locales → old-locales}/admin_ui.es.yml +0 -0
  68. data/config/{locales → old-locales}/admin_ui.et.yml +0 -0
  69. data/config/{locales → old-locales}/admin_ui.fr.yml +0 -0
  70. data/config/{locales → old-locales}/admin_ui.it.yml +0 -0
  71. data/config/{locales → old-locales}/admin_ui.ja.yml +0 -0
  72. data/config/{locales → old-locales}/admin_ui.nb.yml +0 -0
  73. data/config/{locales → old-locales}/admin_ui.nl.yml +0 -0
  74. data/config/{locales → old-locales}/admin_ui.pl.yml +0 -0
  75. data/config/{locales → old-locales}/admin_ui.pt-BR.yml +0 -0
  76. data/config/{locales → old-locales}/admin_ui.pt.yml +0 -0
  77. data/config/{locales → old-locales}/admin_ui.ru.yml +0 -0
  78. data/config/{locales → old-locales}/admin_ui.sk.yml +0 -0
  79. data/config/{locales → old-locales}/admin_ui.sr.yml +0 -0
  80. data/config/{locales → old-locales}/admin_ui.zh-CN.yml +0 -0
  81. data/config/{locales → old-locales}/carrierwave.bg.yml +0 -0
  82. data/config/{locales → old-locales}/carrierwave.cs.yml +0 -0
  83. data/config/{locales → old-locales}/carrierwave.de.yml +0 -0
  84. data/config/{locales → old-locales}/carrierwave.es.yml +0 -0
  85. data/config/{locales → old-locales}/carrierwave.et.yml +0 -0
  86. data/config/old-locales/carrierwave.fr.yml +4 -0
  87. data/config/{locales → old-locales}/carrierwave.it.yml +0 -0
  88. data/config/{locales → old-locales}/carrierwave.ja.yml +0 -0
  89. data/config/{locales → old-locales}/carrierwave.nb.yml +0 -0
  90. data/config/{locales → old-locales}/carrierwave.nl.yml +0 -0
  91. data/config/{locales → old-locales}/carrierwave.pl.yml +0 -0
  92. data/config/{locales → old-locales}/carrierwave.pt-BR.yml +0 -0
  93. data/config/{locales → old-locales}/carrierwave.pt.yml +0 -0
  94. data/config/{locales → old-locales}/carrierwave.ru.yml +0 -0
  95. data/config/{locales → old-locales}/carrierwave.sk.yml +0 -0
  96. data/config/{locales → old-locales}/carrierwave.sr.yml +0 -0
  97. data/config/{locales → old-locales}/carrierwave.zh-CN.yml +0 -0
  98. data/config/{locales → old-locales}/default.bg.yml +0 -0
  99. data/config/{locales → old-locales}/default.cs.yml +0 -0
  100. data/config/{locales → old-locales}/default.de.yml +0 -0
  101. data/config/{locales → old-locales}/default.es.yml +0 -0
  102. data/config/{locales → old-locales}/default.et.yml +0 -0
  103. data/config/old-locales/default.fr.yml +232 -0
  104. data/config/{locales → old-locales}/default.it.yml +0 -0
  105. data/config/{locales → old-locales}/default.ja.yml +0 -0
  106. data/config/{locales → old-locales}/default.nb.yml +0 -0
  107. data/config/{locales → old-locales}/default.nl.yml +0 -0
  108. data/config/{locales → old-locales}/default.pl.yml +0 -0
  109. data/config/{locales → old-locales}/default.pt-BR.yml +0 -0
  110. data/config/{locales → old-locales}/default.pt.yml +0 -0
  111. data/config/{locales → old-locales}/default.ru.yml +0 -0
  112. data/config/{locales → old-locales}/default.sk.yml +0 -0
  113. data/config/{locales → old-locales}/default.sr.yml +0 -0
  114. data/config/{locales → old-locales}/default.zh-CN.yml +0 -0
  115. data/config/{locales → old-locales}/devise.bg.yml +0 -0
  116. data/config/{locales → old-locales}/devise.cs.yml +0 -0
  117. data/config/{locales → old-locales}/devise.de.yml +0 -0
  118. data/config/{locales → old-locales}/devise.es.yml +0 -0
  119. data/config/{locales → old-locales}/devise.et.yml +0 -0
  120. data/config/old-locales/devise.fr.yml +68 -0
  121. data/config/{locales → old-locales}/devise.it.yml +0 -0
  122. data/config/{locales → old-locales}/devise.ja.yml +0 -0
  123. data/config/{locales → old-locales}/devise.nb.yml +0 -0
  124. data/config/{locales → old-locales}/devise.nl.yml +0 -0
  125. data/config/{locales → old-locales}/devise.pl.yml +0 -0
  126. data/config/{locales → old-locales}/devise.pt-BR.yml +0 -0
  127. data/config/{locales → old-locales}/devise.pt.yml +0 -0
  128. data/config/{locales → old-locales}/devise.ru.yml +0 -0
  129. data/config/{locales → old-locales}/devise.sk.yml +0 -0
  130. data/config/{locales → old-locales}/devise.sr.yml +0 -0
  131. data/config/{locales → old-locales}/devise.zh-CN.yml +0 -0
  132. data/config/{locales → old-locales}/flash.bg.yml +0 -0
  133. data/config/{locales → old-locales}/flash.cs.yml +0 -0
  134. data/config/{locales → old-locales}/flash.de.yml +0 -0
  135. data/config/{locales → old-locales}/flash.es.yml +0 -0
  136. data/config/{locales → old-locales}/flash.et.yml +0 -0
  137. data/config/old-locales/flash.fr.yml +106 -0
  138. data/config/{locales → old-locales}/flash.it.yml +0 -0
  139. data/config/{locales → old-locales}/flash.ja.yml +0 -0
  140. data/config/{locales → old-locales}/flash.nb.yml +0 -0
  141. data/config/{locales → old-locales}/flash.nl.yml +0 -0
  142. data/config/{locales → old-locales}/flash.pl.yml +0 -0
  143. data/config/{locales → old-locales}/flash.pt-BR.yml +0 -0
  144. data/config/{locales → old-locales}/flash.pt.yml +0 -0
  145. data/config/{locales → old-locales}/flash.ru.yml +0 -0
  146. data/config/{locales → old-locales}/flash.sk.yml +0 -0
  147. data/config/{locales → old-locales}/flash.sr.yml +0 -0
  148. data/config/{locales → old-locales}/flash.zh-CN.yml +0 -0
  149. data/config/routes.rb +1 -0
  150. data/lib/generators/locomotive/install/templates/carrierwave.rb +12 -7
  151. data/lib/generators/locomotive/install/templates/devise.rb +127 -55
  152. data/lib/generators/locomotive/install/templates/dragonfly.rb +1 -1
  153. data/lib/generators/locomotive/install/templates/locomotive.rb +2 -0
  154. data/lib/locomotive/carrierwave/asset.rb +23 -11
  155. data/lib/locomotive/carrierwave/patches.rb +18 -0
  156. data/lib/locomotive/configuration.rb +6 -5
  157. data/lib/locomotive/dependencies.rb +1 -0
  158. data/lib/locomotive/engine.rb +4 -0
  159. data/lib/locomotive/middlewares/site.rb +1 -0
  160. data/lib/locomotive/steam/middlewares/missing_translations.rb +1 -1
  161. data/lib/locomotive/steam/services/api_entry_submission_service.rb +8 -1
  162. data/lib/locomotive/steam_adaptor.rb +9 -7
  163. data/lib/locomotive/version.rb +1 -1
  164. data/spec/fixtures/assets/ruby_logo.svg +948 -0
  165. data/spec/lib/locomotive/steam/services/api_entry_submission_service_spec.rb +1 -1
  166. data/spec/mailers/locomotive/notifications_spec.rb +39 -1
  167. data/spec/models/locomotive/concerns/site/url_redirections_spec.rb +42 -0
  168. data/spec/models/locomotive/theme_asset_spec.rb +29 -0
  169. data/spec/support/factories.rb +15 -1
  170. data/spec/support/features/site_helpers.rb +8 -1
  171. data/spec/support/shared_contexts/api_site_setup.rb +1 -1
  172. metadata +120 -106
  173. data/app/views/locomotive/shared/_footer.html.slim +0 -2
  174. data/app/views/locomotive/shared/_form_actions.html.slim +0 -14
  175. data/app/views/locomotive/shared/actions/_contents.html.slim +0 -7
  176. data/config/cucumber.yml +0 -8
@@ -0,0 +1,68 @@
1
+ fr:
2
+ errors:
3
+ messages:
4
+ not_found: "non trouvé"
5
+ already_confirmed: "était déjà confirmé"
6
+ not_locked: "n'était pas verouillé"
7
+
8
+ devise:
9
+ failure:
10
+ locomotive_account:
11
+ unauthenticated: "Vous devez vous connecter ou vous inscrire avant de poursuivre."
12
+ unconfirmed: "Vous devez confirmer votre compte avant de poursuivre."
13
+ locked: "Votre compte a été vérrouillé."
14
+ invalid: "Identifiant ou mot de passe invalide."
15
+ not_found_in_database: "Identifiant ou mot de passe invalide."
16
+ invalid_token: "Jeton d'authentification invalide."
17
+ timeout: "Votre session a expiré, veuillez vous reconnecter pour poursuivre."
18
+ inactive: "Votre compte n'a pas encore été activé."
19
+ sessions:
20
+ locomotive_account:
21
+ signed_in: "Connexion réussie."
22
+ signed_out: "Déconnexion réussie."
23
+ passwords:
24
+ locomotive_account:
25
+ send_instructions: "Vous allez recevoir un email avec les instructions pour réinitialiser votre mot de passe dans quelques minutes."
26
+ updated: "Votre mot de passe a été modifié avec succès. Vous êtes maintenant connecté."
27
+ confirmations:
28
+ locomotive_account:
29
+ send_instructions: "Vous allez recevoir un email avec les instruction pour confirmer votre compte dans quelques minutes."
30
+ confirmed: "Votre compte a été confirmé avec succès."
31
+ registrations:
32
+ locomotive_account:
33
+ signed_up: "Vous vous êtes inscrit avec succès. Vous allez recevoir les instructions de confirmation par email."
34
+ updated: "Vous avez mis à jour votre compte avec succès."
35
+ destroyed: "Au revoir. Votre compte a été fermé avec succès. Nous espérons vous revoir bientôt."
36
+ unlocks:
37
+ locomotive_account:
38
+ send_instructions: "Vous allez recevoir un email avec les instructions pour déverrouiller votre compte dans quelques minutes."
39
+ unlocked: "Votre compte a été déverrouillé avec succès. Vous êtes maintenant connecté."
40
+ mailer:
41
+ locomotive_account:
42
+ confirmation_instructions: "Instructions pour la confirmation"
43
+ reset_password_instructions: "Instructions pour la réinitialisation du mot de passe"
44
+ unlock_instructions: "Instructions pour le déverrouillage"
45
+
46
+ locomotive:
47
+ devise_mailer:
48
+ common:
49
+ hello: Bienvenue
50
+
51
+ confirmation_instructions:
52
+ you_can_confirm_your_account_through_the_link_below: "Vous pouvez confirmer votre compte via le lien ci-dessous:"
53
+ confirm_my_account: "Confirmer mon compte"
54
+ reset_password_instructions:
55
+ # For "Someone has requested a link to change your password, and you can do this through the link below."
56
+ reset_password_instruction: "Quelqu'un a demandé un lien pour changer votre mot de passe. Vous pouvez le faire via le lien ci-dessous:"
57
+ change_my_password: "Changer mon mot de passe"
58
+ # For "If you didn't request this, please ignore this email."
59
+ wrong_request_instruction: "Si vous n'avez pas demandé ce changement, ignorez ce message."
60
+ # For "Your password won't change until you access the link above and create a new one."
61
+ unchange_password_message: "Votre mot de passe ne sera pas changé tant vous n'aurez pas accédé au lien ci-dessus pour en créer un nouveau."
62
+ unlock_instructions:
63
+ # For "Your account has been locked due to an excessive amount of unsuccessful sign in attempts."
64
+ locked_account_message: "Votre compte est verrouillé par sécurité suite à un trop grand nombre d'identifications erronées."
65
+ # For "Click the link below to unlock your account"
66
+ unlock_account_instruction: "Cliquez sur le lien ci-dessous pour déverrouiller votre compte:"
67
+ unlock_my_account: "Déverrouiller mon compte"
68
+
@@ -0,0 +1,106 @@
1
+ fr:
2
+ flash:
3
+ locomotive:
4
+ pages:
5
+ create:
6
+ notice: "La page a été créée avec succès."
7
+ alert: "La page n'a pas été créée."
8
+ update:
9
+ notice: "La page a été mise à jour avec succès."
10
+ alert: "La page n'a pas été mise à jour."
11
+ sort:
12
+ notice: "Les pages ont été ordonnées avec succès."
13
+ destroy:
14
+ notice: "La page a été supprimée avec succès."
15
+
16
+ content_entries:
17
+ create:
18
+ notice: "L'élément a été crée avec succès."
19
+ alert: "L'élément n'a pas été crée avec succès."
20
+ update:
21
+ notice: "L'élément a été mis à jour avec succès."
22
+ alert: "L'élément n'a pas été mis à jour."
23
+ sort:
24
+ notice: "Les éléments ont été ordonnés avec succès."
25
+ destroy:
26
+ notice: "L'élément a été supprimé avec succès."
27
+
28
+ content_types:
29
+ create:
30
+ notice: "Le modèle a été crée avec succès."
31
+ alert: "Le modèle n'a pas été crée."
32
+ update:
33
+ notice: "Le modèle a été mis à jour avec succès."
34
+ alert: "Le modèle n'a pas été mis à jour."
35
+ destroy:
36
+ notice: "Le modèle a été supprimé avec succès."
37
+
38
+ current_site:
39
+ update:
40
+ notice: "Mon site a été mis à jour avec succès."
41
+ alert: "Mon site n'a pas été mis à jour."
42
+
43
+ snippets:
44
+ create:
45
+ notice: "Le snippet a été crée avec succès."
46
+ alert: "Le snippet n'a pas été crée."
47
+ update:
48
+ notice: "Le snippet a été mis à jour avec succès."
49
+ alert: "Le snippet n'a pas été mis à jour."
50
+ destroy:
51
+ notice: "Le snippet a été supprimé avec succès."
52
+
53
+ accounts:
54
+ create:
55
+ notice: "Le compte a été crée avec succès."
56
+ alert: "Le compte n'a pas été crée."
57
+
58
+ my_account:
59
+ update:
60
+ notice: "Mon compte a été mis à jour avec succès."
61
+ alert: "Mon compte n'a pas été mis à jour."
62
+
63
+ sites:
64
+ create:
65
+ notice: "Le site a été crée avec succès."
66
+ alert: "Le site n'a pas été crée."
67
+ destroy:
68
+ notice: "Le site a été supprimé avec succès."
69
+
70
+ memberships:
71
+ create:
72
+ notice: "Le compte a été ajouté avec succès."
73
+ alert: "Le compte n'a pas été ajouté."
74
+ already_created: "Le compte a déjà été ajouté pour ce site."
75
+
76
+ assets:
77
+ create:
78
+ notice: "Le média a été crée avec succès."
79
+ alert: "Le média n'a pas été crée."
80
+ update:
81
+ notice: "Le média a été mis à jour avec succès."
82
+ alert: "Le média n'a pas été mis à jour."
83
+
84
+ theme_assets:
85
+ create:
86
+ notice: "Le fichier a été crée avec succès."
87
+ alert: "Le fichier n'a pas été crée."
88
+ update:
89
+ notice: "Le fichier a été mis à jour avec succès."
90
+ alert: "Le fichier n'a pas été mis à jour."
91
+ destroy:
92
+ notice: "Le fichier a été supprimé avec succès."
93
+
94
+ custom_fields:
95
+ update:
96
+ alert: "Champ non mis à jour."
97
+
98
+ cross_domain_sessions:
99
+ create:
100
+ alert: "Vous devez vous authentifier"
101
+
102
+ import:
103
+ create:
104
+ done: "Votre site a été mis à jour"
105
+ notice: "Votre site est en train d'être mis à jour"
106
+ alert: "L'import n'a pas pu se faire"
@@ -68,6 +68,7 @@ Locomotive::Engine.routes.draw do
68
68
  resource :current_site, controller: 'current_site' do
69
69
  get :new_domain
70
70
  get :new_locale
71
+ get :new_url_redirection
71
72
  end
72
73
 
73
74
  # Preview mode handled by Steam
@@ -10,14 +10,19 @@ CarrierWave.configure do |config|
10
10
 
11
11
  when :production
12
12
  # the following configuration works for Amazon S3
13
- config.storage = :fog
14
- config.fog_credentials = {
15
- provider: 'AWS',
16
- aws_access_key_id: ENV['S3_KEY_ID'],
17
- aws_secret_access_key: ENV['S3_SECRET_KEY'],
18
- region: ENV['S3_BUCKET_REGION']
13
+ #
14
+ # WARNING: add the "carrierwave-aws" gem in your Rails app Gemfile.
15
+ # More information here: https://github.com/sorentwo/carrierwave-aws
16
+ #
17
+ config.storage = :aws
18
+ config.aws_bucket = ENV['S3_BUCKET']
19
+ config.aws_acl = 'public-read'
20
+
21
+ config.aws_credentials = {
22
+ access_key_id: ENV['S3_KEY_ID'],
23
+ secret_access_key: ENV['S3_SECRET_KEY'],
24
+ region: ENV['S3_BUCKET_REGION']
19
25
  }
20
- config.fog_directory = ENV['S3_BUCKET']
21
26
 
22
27
  else
23
28
  # settings for the local filesystem
@@ -1,12 +1,21 @@
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.
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
3
  Devise.setup do |config|
4
+ # The secret key used by Devise. Devise uses this key to generate
5
+ # random tokens. Changing this key will render invalid all existing
6
+ # confirmation, reset password and unlock tokens in the database.
7
+ # Devise will use the `secret_key_base` on Rails 4+ applications as its `secret_key`
8
+ # by default. You can change it below and use your own secret key.
9
+ # config.secret_key = '<%= SecureRandom.hex(64) %>'
10
+
4
11
  # ==> Mailer Configuration
5
- # Configure the e-mail address which will be shown in DeviseMailer.
6
- config.mailer_sender = 'sender@dummyapp.org'
12
+ # Configure the e-mail address which will be shown in Devise::Mailer,
13
+ # note that it will be overwritten if you use your own mailer class
14
+ # with default "from" parameter.
15
+ config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
7
16
 
8
17
  # Configure the class responsible to send e-mails.
9
- # config.mailer = "Locomotive::DeviseMailer"
18
+ # config.mailer = 'Devise::Mailer'
10
19
 
11
20
  # ==> ORM configuration
12
21
  # Load and configure the ORM. Supports :active_record (default) and
@@ -22,7 +31,7 @@ Devise.setup do |config|
22
31
  # session. If you need permissions, you should implement that in a before filter.
23
32
  # You can also supply a hash where the value is a boolean determining whether
24
33
  # or not authentication should be aborted when the value is not present.
25
- # config.authentication_keys = [ :email ]
34
+ # config.authentication_keys = [:email]
26
35
 
27
36
  # Configure parameters from the request object used for authentication. Each entry
28
37
  # given should be a request method and it will automatically be passed to the
@@ -34,57 +43,111 @@ Devise.setup do |config|
34
43
  # Configure which authentication keys should be case-insensitive.
35
44
  # These keys will be downcased upon creating or modifying a user and when used
36
45
  # to authenticate or find a user. Default is :email.
37
- config.case_insensitive_keys = [ :email ]
46
+ config.case_insensitive_keys = [:email]
47
+
48
+ # Configure which authentication keys should have whitespace stripped.
49
+ # These keys will have whitespace before and after removed upon creating or
50
+ # modifying a user and when used to authenticate or find a user. Default is :email.
51
+ config.strip_whitespace_keys = [:email]
38
52
 
39
53
  # Tell if authentication through request.params is enabled. True by default.
54
+ # It can be set to an array that will enable params authentication only for the
55
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
56
+ # enable it only for database (email + password) authentication.
40
57
  # config.params_authenticatable = true
41
58
 
42
- # Tell if authentication through HTTP Basic Auth is enabled. False by default.
59
+ # Tell if authentication through HTTP Auth is enabled. False by default.
60
+ # It can be set to an array that will enable http authentication only for the
61
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
62
+ # enable it only for database authentication. The supported strategies are:
63
+ # :database = Support basic authentication with authentication key + password
43
64
  # config.http_authenticatable = false
44
65
 
45
- # If http headers should be returned for AJAX requests. True by default.
66
+ # If 401 status code should be returned for AJAX requests. True by default.
46
67
  # config.http_authenticatable_on_xhr = true
47
68
 
48
- # The realm used in Http Basic Authentication. "Application" by default.
49
- # config.http_authentication_realm = "Application"
69
+ # The realm used in Http Basic Authentication. 'Application' by default.
70
+ # config.http_authentication_realm = 'Application'
71
+
72
+ # It will change confirmation, password recovery and other workflows
73
+ # to behave the same regardless if the e-mail provided was right or wrong.
74
+ # Does not affect registerable.
75
+ # config.paranoid = true
76
+
77
+ # By default Devise will store the user in session. You can skip storage for
78
+ # particular strategies by setting this option.
79
+ # Notice that if you are skipping storage for all authentication paths, you
80
+ # may want to disable generating routes to Devise's sessions controller by
81
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
82
+ config.skip_session_storage = [:http_auth]
83
+
84
+ # By default, Devise cleans up the CSRF token on authentication to
85
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
86
+ # requests for sign in and sign up, you need to get a new CSRF token
87
+ # from the server. You can disable this option at your own risk.
88
+ # config.clean_up_csrf_token_on_authentication = true
50
89
 
51
90
  # ==> Configuration for :database_authenticatable
52
91
  # For bcrypt, this is the cost for hashing the password and defaults to 10. If
53
92
  # using other encryptors, it sets how many times you want the password re-encrypted.
54
- config.stretches = 10
93
+ #
94
+ # Limiting the stretches to just one in testing will increase the performance of
95
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
96
+ # a value less than 10 in other environments. Note that, for bcrypt (the default
97
+ # encryptor), the cost increases exponentially with the number of stretches (e.g.
98
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
99
+ config.stretches = Rails.env.test? ? 1 : 10
55
100
 
56
101
  # Setup a pepper to generate the encrypted password.
57
- # config.pepper = "de368d6a1517489510a2ae145328ff1c238f03b02da8f57032936a353835e2ca20561decfb5f7bfafad095fa73cee55b101ed11a0d0f913429d3d9bd114d810e"
102
+ config.pepper = '<%= SecureRandom.hex(64) %>'
58
103
 
59
104
  # ==> Configuration for :confirmable
60
- # The time you want to give your user to confirm his account. During this time
61
- # he will be able to access your application without confirming. Default is 0.days
62
- # When allow_unconfirmed_access_for is zero, the user won't be able to sign in without confirming.
63
- # You can use this to let your user access some features of your application
64
- # without confirming the account, but blocking it after a certain period
65
- # (ie 2 days).
105
+ # A period that the user is allowed to access the website even without
106
+ # confirming their account. For instance, if set to 2.days, the user will be
107
+ # able to access the website for two days without confirming their account,
108
+ # access will be blocked just in the third day. Default is 0.days, meaning
109
+ # the user cannot access the website without confirming their account.
66
110
  # config.allow_unconfirmed_access_for = 2.days
67
111
 
112
+ # A period that the user is allowed to confirm their account before their
113
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
114
+ # their account within 3 days after the mail was sent, but on the fourth day
115
+ # their account can't be confirmed with the token any more.
116
+ # Default is nil, meaning there is no restriction on how long a user can take
117
+ # before confirming their account.
118
+ # config.confirm_within = 3.days
119
+
120
+ # If true, requires any email changes to be confirmed (exactly the same way as
121
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
122
+ # db field (see migrations). Until confirmed, new email is stored in
123
+ # unconfirmed_email column, and copied to email column on successful confirmation.
124
+ config.reconfirmable = true
125
+
68
126
  # Defines which key will be used when confirming an account
69
- # config.confirmation_keys = [ :email ]
127
+ # config.confirmation_keys = [:email]
70
128
 
71
129
  # ==> Configuration for :rememberable
72
130
  # The time the user will be remembered without asking for credentials again.
73
- config.remember_for = 2.weeks
131
+ # config.remember_for = 2.weeks
132
+
133
+ # Invalidates all the remember me tokens when the user signs out.
134
+ config.expire_all_remember_me_on_sign_out = true
74
135
 
75
136
  # If true, extends the user's remember period when remembered via cookie.
76
137
  # config.extend_remember_period = false
77
138
 
78
139
  # Options to be passed to the created cookie. For instance, you can set
79
- # :secure => true in order to force SSL only cookies.
80
- # config.cookie_options = {}
140
+ # secure: true in order to force SSL only cookies.
141
+ # config.rememberable_options = {}
81
142
 
82
143
  # ==> Configuration for :validatable
83
- # Range for password length. Default is 8..128.
84
- config.password_length = 6..128
144
+ # Range for password length.
145
+ config.password_length = 6..72
85
146
 
86
- # Regex to use to validate the email address
87
- # config.email_regexp = /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i
147
+ # Email regex used to validate email formats. It simply asserts that
148
+ # one (and only one) @ exists in the given string. This is mainly
149
+ # to give user feedback and not to assert the e-mail validity.
150
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
88
151
 
89
152
  # ==> Configuration for :timeoutable
90
153
  # The time you want to timeout the user session without activity. After this
@@ -98,7 +161,7 @@ Devise.setup do |config|
98
161
  # config.lock_strategy = :failed_attempts
99
162
 
100
163
  # Defines which key will be used when locking and unlocking an account
101
- # config.unlock_keys = [ :email ]
164
+ # config.unlock_keys = [:email]
102
165
 
103
166
  # Defines which strategy will be used to unlock an account.
104
167
  # :email = Sends an unlock link to the user email
@@ -114,34 +177,32 @@ Devise.setup do |config|
114
177
  # Time interval to unlock the account if :time is enabled as unlock_strategy.
115
178
  # config.unlock_in = 1.hour
116
179
 
180
+ # Warn on the last attempt before the account is locked.
181
+ # config.last_attempt_warning = true
182
+
117
183
  # ==> Configuration for :recoverable
118
184
  #
119
185
  # Defines which key will be used when recovering the password for an account
120
- # config.reset_password_keys = [ :email ]
186
+ # config.reset_password_keys = [:email]
121
187
 
122
188
  # Time interval you can reset your password with a reset password key.
123
189
  # Don't put a too small interval or your users won't have the time to
124
190
  # change their passwords.
125
- config.reset_password_within = 2.hours
191
+ config.reset_password_within = 6.hours
192
+
193
+ # When set to false, does not sign a user in automatically after their password is
194
+ # reset. Defaults to true, so a user is signed in automatically after a reset.
195
+ # config.sign_in_after_reset_password = true
126
196
 
127
197
  # ==> Configuration for :encryptable
128
198
  # Allow you to use another encryption algorithm besides bcrypt (default). You can use
129
199
  # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
130
200
  # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
131
201
  # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
132
- # REST_AUTH_SITE_KEY to pepper)
133
- # config.encryptor = :sha1
134
-
135
- # ==> Configuration for :token_authenticatable
136
- # Defines name of the authentication token params key
137
- # config.token_authentication_key = :auth_token
138
-
139
- # If true, authentication through token does not store user in session and needs
140
- # to be supplied on each request. Useful if you are using the token as API token.
141
- # config.stateless_token = false
142
- # Hint: Devise 2
143
- # Devise.stateless_token was removed. If you want to have stateless tokens,
144
- # simply do config.skip_session_storage << :auth_token in your initializer;
202
+ # REST_AUTH_SITE_KEY to pepper).
203
+ #
204
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
205
+ # config.encryptor = :sha512
145
206
 
146
207
  # ==> Scopes configuration
147
208
  # Turn scoped views on. Before rendering "sessions/new", it will first check for
@@ -151,11 +212,10 @@ Devise.setup do |config|
151
212
 
152
213
  # Configure the default scope given to Warden. By default it's the first
153
214
  # devise role declared in your routes (usually :user).
154
- # config.default_scope = :account
215
+ # config.default_scope = :user
155
216
 
156
- # Configure sign_out behavior.
157
- # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
158
- # The default is true, which means any logout action will sign out all active scopes.
217
+ # Set this configuration to false if you want /users/sign_out to sign out
218
+ # only the current scope. By default, Devise signs out all scopes.
159
219
  # config.sign_out_all_scopes = true
160
220
 
161
221
  # ==> Navigation configuration
@@ -166,25 +226,37 @@ Devise.setup do |config|
166
226
  # If you have any extra navigational formats, like :iphone or :mobile, you
167
227
  # should add them to the navigational formats lists.
168
228
  #
169
- # The :"*/*" and "*/*" formats below is required to match Internet
170
- # Explorer requests.
171
- # config.navigational_formats = [:"*/*", "*/*", :html]
229
+ # The "*/*" below is required to match Internet Explorer requests.
230
+ # config.navigational_formats = ['*/*', :html]
172
231
 
173
- # The default HTTP method used to sign out a resource. Default is :get.
174
- # config.sign_out_via = :get
232
+ # The default HTTP method used to sign out a resource. Default is :delete.
233
+ config.sign_out_via = :delete
175
234
 
176
235
  # ==> OmniAuth
177
236
  # Add a new OmniAuth provider. Check the wiki for more information on setting
178
237
  # up on your models and hooks.
179
- # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
238
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
180
239
 
181
240
  # ==> Warden configuration
182
241
  # If you want to use other strategies, that are not supported by Devise, or
183
242
  # change the failure app, you can configure them inside the config.warden block.
184
243
  #
185
244
  # config.warden do |manager|
186
- # manager.failure_app = AnotherApp
187
245
  # manager.intercept_401 = false
188
- # manager.default_strategies(:scope => :user).unshift :some_external_strategy
246
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
189
247
  # end
248
+
249
+ # ==> Mountable engine configurations
250
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
251
+ # is mountable, there are some extra configurations to be taken into account.
252
+ # The following options are available, assuming the engine is mounted as:
253
+ #
254
+ # mount MyEngine, at: '/my_engine'
255
+ #
256
+ # The router that invoked `devise_for`, in the example above, would be:
257
+ # config.router_name = :my_engine
258
+ #
259
+ # When using OmniAuth, Devise cannot automatically set OmniAuth path,
260
+ # so you need to do it manually. For the users scope, it would be:
261
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
190
262
  end