devise 3.5.10 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +279 -1126
- data/MIT-LICENSE +2 -1
- data/README.md +291 -97
- data/app/controllers/devise/confirmations_controller.rb +3 -1
- data/app/controllers/devise/omniauth_callbacks_controller.rb +8 -6
- data/app/controllers/devise/passwords_controller.rb +7 -4
- data/app/controllers/devise/registrations_controller.rb +39 -18
- data/app/controllers/devise/sessions_controller.rb +9 -7
- data/app/controllers/devise/unlocks_controller.rb +4 -2
- data/app/controllers/devise_controller.rb +25 -12
- data/app/helpers/devise_helper.rb +23 -18
- data/app/mailers/devise/mailer.rb +10 -4
- data/app/views/devise/confirmations/new.html.erb +2 -2
- data/app/views/devise/mailer/email_changed.html.erb +7 -0
- data/app/views/devise/passwords/edit.html.erb +3 -3
- data/app/views/devise/passwords/new.html.erb +2 -2
- data/app/views/devise/registrations/edit.html.erb +9 -5
- data/app/views/devise/registrations/new.html.erb +4 -4
- data/app/views/devise/sessions/new.html.erb +4 -4
- data/app/views/devise/shared/_error_messages.html.erb +15 -0
- data/app/views/devise/shared/_links.html.erb +8 -8
- data/app/views/devise/unlocks/new.html.erb +2 -2
- data/config/locales/en.yml +5 -2
- data/lib/devise.rb +57 -40
- data/lib/devise/controllers/helpers.rb +30 -27
- data/lib/devise/controllers/rememberable.rb +3 -1
- data/lib/devise/controllers/scoped_views.rb +2 -0
- data/lib/devise/controllers/sign_in_out.rb +39 -14
- data/lib/devise/controllers/store_location.rb +25 -7
- data/lib/devise/controllers/url_helpers.rb +3 -1
- data/lib/devise/delegator.rb +2 -0
- data/lib/devise/encryptor.rb +6 -4
- data/lib/devise/failure_app.rb +75 -38
- data/lib/devise/hooks/activatable.rb +2 -0
- data/lib/devise/hooks/csrf_cleaner.rb +2 -0
- data/lib/devise/hooks/forgetable.rb +2 -0
- data/lib/devise/hooks/lockable.rb +4 -2
- data/lib/devise/hooks/proxy.rb +3 -1
- data/lib/devise/hooks/rememberable.rb +2 -0
- data/lib/devise/hooks/timeoutable.rb +4 -2
- data/lib/devise/hooks/trackable.rb +2 -0
- data/lib/devise/mailers/helpers.rb +7 -4
- data/lib/devise/mapping.rb +3 -1
- data/lib/devise/models.rb +3 -1
- data/lib/devise/models/authenticatable.rb +63 -33
- data/lib/devise/models/confirmable.rb +90 -29
- data/lib/devise/models/database_authenticatable.rb +93 -22
- data/lib/devise/models/lockable.rb +19 -5
- data/lib/devise/models/omniauthable.rb +2 -0
- data/lib/devise/models/recoverable.rb +33 -21
- data/lib/devise/models/registerable.rb +4 -0
- data/lib/devise/models/rememberable.rb +6 -11
- data/lib/devise/models/timeoutable.rb +2 -0
- data/lib/devise/models/trackable.rb +15 -1
- data/lib/devise/models/validatable.rb +10 -3
- data/lib/devise/modules.rb +2 -0
- data/lib/devise/omniauth.rb +4 -5
- data/lib/devise/omniauth/config.rb +2 -0
- data/lib/devise/omniauth/url_helpers.rb +14 -5
- data/lib/devise/orm/active_record.rb +5 -1
- data/lib/devise/orm/mongoid.rb +6 -2
- data/lib/devise/parameter_filter.rb +4 -0
- data/lib/devise/parameter_sanitizer.rb +139 -65
- data/lib/devise/rails.rb +7 -16
- data/lib/devise/rails/deprecated_constant_accessor.rb +39 -0
- data/lib/devise/rails/routes.rb +48 -37
- data/lib/devise/rails/warden_compat.rb +3 -10
- data/lib/devise/secret_key_finder.rb +27 -0
- data/lib/devise/strategies/authenticatable.rb +3 -1
- data/lib/devise/strategies/base.rb +2 -0
- data/lib/devise/strategies/database_authenticatable.rb +11 -4
- data/lib/devise/strategies/rememberable.rb +2 -0
- data/lib/devise/test/controller_helpers.rb +167 -0
- data/lib/devise/test/integration_helpers.rb +63 -0
- data/lib/devise/test_helpers.rb +7 -124
- data/lib/devise/time_inflector.rb +2 -0
- data/lib/devise/token_generator.rb +3 -41
- data/lib/devise/version.rb +3 -1
- data/lib/generators/active_record/devise_generator.rb +46 -12
- data/lib/generators/active_record/templates/migration.rb +4 -2
- data/lib/generators/active_record/templates/migration_existing.rb +4 -2
- data/lib/generators/devise/controllers_generator.rb +3 -1
- data/lib/generators/devise/devise_generator.rb +5 -3
- data/lib/generators/devise/install_generator.rb +18 -5
- data/lib/generators/devise/orm_helpers.rb +10 -21
- data/lib/generators/devise/views_generator.rb +8 -9
- data/lib/generators/mongoid/devise_generator.rb +7 -5
- data/lib/generators/templates/README +9 -8
- data/lib/generators/templates/controllers/confirmations_controller.rb +2 -0
- data/lib/generators/templates/controllers/omniauth_callbacks_controller.rb +3 -1
- data/lib/generators/templates/controllers/passwords_controller.rb +2 -0
- data/lib/generators/templates/controllers/registrations_controller.rb +6 -4
- data/lib/generators/templates/controllers/sessions_controller.rb +4 -2
- data/lib/generators/templates/controllers/unlocks_controller.rb +2 -0
- data/lib/generators/templates/devise.rb +63 -21
- data/lib/generators/templates/markerb/email_changed.markerb +7 -0
- data/lib/generators/templates/markerb/password_change.markerb +2 -2
- data/lib/generators/templates/simple_form_for/confirmations/new.html.erb +5 -1
- data/lib/generators/templates/simple_form_for/passwords/edit.html.erb +10 -2
- data/lib/generators/templates/simple_form_for/passwords/new.html.erb +4 -1
- data/lib/generators/templates/simple_form_for/registrations/edit.html.erb +11 -3
- data/lib/generators/templates/simple_form_for/registrations/new.html.erb +11 -3
- data/lib/generators/templates/simple_form_for/sessions/new.html.erb +7 -2
- data/lib/generators/templates/simple_form_for/unlocks/new.html.erb +4 -1
- metadata +19 -317
- data/.gitignore +0 -10
- data/.travis.yml +0 -44
- data/.yardopts +0 -9
- data/CODE_OF_CONDUCT.md +0 -22
- data/CONTRIBUTING.md +0 -16
- data/Gemfile +0 -30
- data/Gemfile.lock +0 -187
- data/Rakefile +0 -36
- data/devise.gemspec +0 -27
- data/devise.png +0 -0
- data/gemfiles/Gemfile.rails-3.2-stable +0 -29
- data/gemfiles/Gemfile.rails-3.2-stable.lock +0 -172
- data/gemfiles/Gemfile.rails-4.0-stable +0 -30
- data/gemfiles/Gemfile.rails-4.0-stable.lock +0 -166
- data/gemfiles/Gemfile.rails-4.1-stable +0 -30
- data/gemfiles/Gemfile.rails-4.1-stable.lock +0 -171
- data/gemfiles/Gemfile.rails-4.2-stable +0 -30
- data/gemfiles/Gemfile.rails-4.2-stable.lock +0 -193
- data/script/cached-bundle +0 -49
- data/script/s3-put +0 -71
- data/test/controllers/custom_registrations_controller_test.rb +0 -40
- data/test/controllers/custom_strategy_test.rb +0 -62
- data/test/controllers/helper_methods_test.rb +0 -21
- data/test/controllers/helpers_test.rb +0 -316
- data/test/controllers/inherited_controller_i18n_messages_test.rb +0 -51
- data/test/controllers/internal_helpers_test.rb +0 -129
- data/test/controllers/load_hooks_controller_test.rb +0 -19
- data/test/controllers/passwords_controller_test.rb +0 -31
- data/test/controllers/sessions_controller_test.rb +0 -103
- data/test/controllers/url_helpers_test.rb +0 -65
- data/test/delegator_test.rb +0 -19
- data/test/devise_test.rb +0 -107
- data/test/failure_app_test.rb +0 -315
- data/test/generators/active_record_generator_test.rb +0 -109
- data/test/generators/controllers_generator_test.rb +0 -48
- data/test/generators/devise_generator_test.rb +0 -39
- data/test/generators/install_generator_test.rb +0 -13
- data/test/generators/mongoid_generator_test.rb +0 -23
- data/test/generators/views_generator_test.rb +0 -103
- data/test/helpers/devise_helper_test.rb +0 -49
- data/test/integration/authenticatable_test.rb +0 -729
- data/test/integration/confirmable_test.rb +0 -324
- data/test/integration/database_authenticatable_test.rb +0 -95
- data/test/integration/http_authenticatable_test.rb +0 -105
- data/test/integration/lockable_test.rb +0 -239
- data/test/integration/omniauthable_test.rb +0 -135
- data/test/integration/recoverable_test.rb +0 -347
- data/test/integration/registerable_test.rb +0 -359
- data/test/integration/rememberable_test.rb +0 -214
- data/test/integration/timeoutable_test.rb +0 -184
- data/test/integration/trackable_test.rb +0 -92
- data/test/mailers/confirmation_instructions_test.rb +0 -115
- data/test/mailers/reset_password_instructions_test.rb +0 -96
- data/test/mailers/unlock_instructions_test.rb +0 -91
- data/test/mapping_test.rb +0 -134
- data/test/models/authenticatable_test.rb +0 -23
- data/test/models/confirmable_test.rb +0 -511
- data/test/models/database_authenticatable_test.rb +0 -269
- data/test/models/lockable_test.rb +0 -350
- data/test/models/omniauthable_test.rb +0 -7
- data/test/models/recoverable_test.rb +0 -251
- data/test/models/registerable_test.rb +0 -7
- data/test/models/rememberable_test.rb +0 -169
- data/test/models/serializable_test.rb +0 -49
- data/test/models/timeoutable_test.rb +0 -51
- data/test/models/trackable_test.rb +0 -41
- data/test/models/validatable_test.rb +0 -127
- data/test/models_test.rb +0 -153
- data/test/omniauth/config_test.rb +0 -57
- data/test/omniauth/url_helpers_test.rb +0 -54
- data/test/orm/active_record.rb +0 -10
- data/test/orm/mongoid.rb +0 -13
- data/test/parameter_sanitizer_test.rb +0 -81
- data/test/rails_app/Rakefile +0 -6
- data/test/rails_app/app/active_record/admin.rb +0 -6
- data/test/rails_app/app/active_record/shim.rb +0 -2
- data/test/rails_app/app/active_record/user.rb +0 -6
- data/test/rails_app/app/active_record/user_on_engine.rb +0 -7
- data/test/rails_app/app/active_record/user_on_main_app.rb +0 -7
- data/test/rails_app/app/active_record/user_without_email.rb +0 -8
- data/test/rails_app/app/controllers/admins/sessions_controller.rb +0 -6
- data/test/rails_app/app/controllers/admins_controller.rb +0 -6
- data/test/rails_app/app/controllers/application_controller.rb +0 -12
- data/test/rails_app/app/controllers/application_with_fake_engine.rb +0 -30
- data/test/rails_app/app/controllers/custom/registrations_controller.rb +0 -31
- data/test/rails_app/app/controllers/home_controller.rb +0 -25
- data/test/rails_app/app/controllers/publisher/registrations_controller.rb +0 -2
- data/test/rails_app/app/controllers/publisher/sessions_controller.rb +0 -2
- data/test/rails_app/app/controllers/users/omniauth_callbacks_controller.rb +0 -14
- data/test/rails_app/app/controllers/users_controller.rb +0 -31
- data/test/rails_app/app/helpers/application_helper.rb +0 -3
- data/test/rails_app/app/mailers/users/from_proc_mailer.rb +0 -3
- data/test/rails_app/app/mailers/users/mailer.rb +0 -3
- data/test/rails_app/app/mailers/users/reply_to_mailer.rb +0 -4
- data/test/rails_app/app/mongoid/admin.rb +0 -29
- data/test/rails_app/app/mongoid/shim.rb +0 -23
- data/test/rails_app/app/mongoid/user.rb +0 -39
- data/test/rails_app/app/mongoid/user_on_engine.rb +0 -39
- data/test/rails_app/app/mongoid/user_on_main_app.rb +0 -39
- data/test/rails_app/app/mongoid/user_without_email.rb +0 -33
- data/test/rails_app/app/views/admins/index.html.erb +0 -1
- data/test/rails_app/app/views/admins/sessions/new.html.erb +0 -2
- data/test/rails_app/app/views/home/admin_dashboard.html.erb +0 -1
- data/test/rails_app/app/views/home/index.html.erb +0 -1
- data/test/rails_app/app/views/home/join.html.erb +0 -1
- data/test/rails_app/app/views/home/private.html.erb +0 -1
- data/test/rails_app/app/views/home/user_dashboard.html.erb +0 -1
- data/test/rails_app/app/views/layouts/application.html.erb +0 -24
- data/test/rails_app/app/views/users/edit_form.html.erb +0 -1
- data/test/rails_app/app/views/users/index.html.erb +0 -1
- data/test/rails_app/app/views/users/mailer/confirmation_instructions.erb +0 -1
- data/test/rails_app/app/views/users/sessions/new.html.erb +0 -1
- data/test/rails_app/bin/bundle +0 -3
- data/test/rails_app/bin/rails +0 -4
- data/test/rails_app/bin/rake +0 -4
- data/test/rails_app/config.ru +0 -4
- data/test/rails_app/config/application.rb +0 -40
- data/test/rails_app/config/boot.rb +0 -14
- data/test/rails_app/config/database.yml +0 -18
- data/test/rails_app/config/environment.rb +0 -5
- data/test/rails_app/config/environments/development.rb +0 -30
- data/test/rails_app/config/environments/production.rb +0 -84
- data/test/rails_app/config/environments/test.rb +0 -41
- data/test/rails_app/config/initializers/backtrace_silencers.rb +0 -7
- data/test/rails_app/config/initializers/devise.rb +0 -180
- data/test/rails_app/config/initializers/inflections.rb +0 -2
- data/test/rails_app/config/initializers/secret_token.rb +0 -8
- data/test/rails_app/config/initializers/session_store.rb +0 -1
- data/test/rails_app/config/routes.rb +0 -125
- data/test/rails_app/db/migrate/20100401102949_create_tables.rb +0 -71
- data/test/rails_app/db/schema.rb +0 -55
- data/test/rails_app/lib/shared_admin.rb +0 -17
- data/test/rails_app/lib/shared_user.rb +0 -29
- data/test/rails_app/lib/shared_user_without_email.rb +0 -26
- data/test/rails_app/lib/shared_user_without_omniauth.rb +0 -13
- data/test/rails_app/public/404.html +0 -26
- data/test/rails_app/public/422.html +0 -26
- data/test/rails_app/public/500.html +0 -26
- data/test/rails_app/public/favicon.ico +0 -0
- data/test/rails_test.rb +0 -9
- data/test/routes_test.rb +0 -264
- data/test/support/action_controller/record_identifier.rb +0 -10
- data/test/support/assertions.rb +0 -39
- data/test/support/helpers.rb +0 -77
- data/test/support/integration.rb +0 -92
- data/test/support/locale/en.yml +0 -8
- data/test/support/mongoid.yml +0 -6
- data/test/support/webrat/integrations/rails.rb +0 -24
- data/test/test_helper.rb +0 -34
- data/test/test_helpers_test.rb +0 -178
- data/test/test_models.rb +0 -33
- data/test/time_helpers.rb +0 -137
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<h2>Change your password</h2>
|
|
2
2
|
|
|
3
3
|
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
|
|
4
|
-
<%=
|
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
|
5
5
|
<%= f.hidden_field :reset_password_token %>
|
|
6
6
|
|
|
7
7
|
<div class="field">
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
<% if @minimum_password_length %>
|
|
10
10
|
<em>(<%= @minimum_password_length %> characters minimum)</em><br />
|
|
11
11
|
<% end %>
|
|
12
|
-
<%= f.password_field :password, autofocus: true, autocomplete: "
|
|
12
|
+
<%= f.password_field :password, autofocus: true, autocomplete: "new-password" %>
|
|
13
13
|
</div>
|
|
14
14
|
|
|
15
15
|
<div class="field">
|
|
16
16
|
<%= f.label :password_confirmation, "Confirm new password" %><br />
|
|
17
|
-
<%= f.password_field :password_confirmation, autocomplete: "
|
|
17
|
+
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
|
|
18
18
|
</div>
|
|
19
19
|
|
|
20
20
|
<div class="actions">
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<h2>Forgot your password?</h2>
|
|
2
2
|
|
|
3
3
|
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
|
|
4
|
-
<%=
|
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
|
5
5
|
|
|
6
6
|
<div class="field">
|
|
7
7
|
<%= f.label :email %><br />
|
|
8
|
-
<%= f.email_field :email, autofocus: true %>
|
|
8
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
11
|
<div class="actions">
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<h2>Edit <%= resource_name.to_s.humanize %></h2>
|
|
2
2
|
|
|
3
3
|
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
|
4
|
-
<%=
|
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
|
5
5
|
|
|
6
6
|
<div class="field">
|
|
7
7
|
<%= f.label :email %><br />
|
|
8
|
-
<%= f.email_field :email, autofocus: true %>
|
|
8
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
11
|
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
|
@@ -14,17 +14,21 @@
|
|
|
14
14
|
|
|
15
15
|
<div class="field">
|
|
16
16
|
<%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
|
|
17
|
-
<%= f.password_field :password, autocomplete: "
|
|
17
|
+
<%= f.password_field :password, autocomplete: "new-password" %>
|
|
18
|
+
<% if @minimum_password_length %>
|
|
19
|
+
<br />
|
|
20
|
+
<em><%= @minimum_password_length %> characters minimum</em>
|
|
21
|
+
<% end %>
|
|
18
22
|
</div>
|
|
19
23
|
|
|
20
24
|
<div class="field">
|
|
21
25
|
<%= f.label :password_confirmation %><br />
|
|
22
|
-
<%= f.password_field :password_confirmation, autocomplete: "
|
|
26
|
+
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
|
|
23
27
|
</div>
|
|
24
28
|
|
|
25
29
|
<div class="field">
|
|
26
30
|
<%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
|
|
27
|
-
<%= f.password_field :current_password, autocomplete: "
|
|
31
|
+
<%= f.password_field :current_password, autocomplete: "current-password" %>
|
|
28
32
|
</div>
|
|
29
33
|
|
|
30
34
|
<div class="actions">
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<h2>Sign up</h2>
|
|
2
2
|
|
|
3
3
|
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
|
4
|
-
<%=
|
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
|
5
5
|
|
|
6
6
|
<div class="field">
|
|
7
7
|
<%= f.label :email %><br />
|
|
8
|
-
<%= f.email_field :email, autofocus: true %>
|
|
8
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
11
|
<div class="field">
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
<% if @minimum_password_length %>
|
|
14
14
|
<em>(<%= @minimum_password_length %> characters minimum)</em>
|
|
15
15
|
<% end %><br />
|
|
16
|
-
<%= f.password_field :password, autocomplete: "
|
|
16
|
+
<%= f.password_field :password, autocomplete: "new-password" %>
|
|
17
17
|
</div>
|
|
18
18
|
|
|
19
19
|
<div class="field">
|
|
20
20
|
<%= f.label :password_confirmation %><br />
|
|
21
|
-
<%= f.password_field :password_confirmation, autocomplete: "
|
|
21
|
+
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
|
|
22
22
|
</div>
|
|
23
23
|
|
|
24
24
|
<div class="actions">
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
|
|
4
4
|
<div class="field">
|
|
5
5
|
<%= f.label :email %><br />
|
|
6
|
-
<%= f.email_field :email, autofocus: true %>
|
|
6
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
|
7
7
|
</div>
|
|
8
8
|
|
|
9
9
|
<div class="field">
|
|
10
10
|
<%= f.label :password %><br />
|
|
11
|
-
<%= f.password_field :password, autocomplete: "
|
|
11
|
+
<%= f.password_field :password, autocomplete: "current-password" %>
|
|
12
12
|
</div>
|
|
13
13
|
|
|
14
|
-
<% if devise_mapping.rememberable?
|
|
14
|
+
<% if devise_mapping.rememberable? %>
|
|
15
15
|
<div class="field">
|
|
16
16
|
<%= f.check_box :remember_me %>
|
|
17
17
|
<%= f.label :remember_me %>
|
|
18
18
|
</div>
|
|
19
|
-
<% end
|
|
19
|
+
<% end %>
|
|
20
20
|
|
|
21
21
|
<div class="actions">
|
|
22
22
|
<%= f.submit "Log in" %>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<% if resource.errors.any? %>
|
|
2
|
+
<div id="error_explanation">
|
|
3
|
+
<h2>
|
|
4
|
+
<%= I18n.t("errors.messages.not_saved",
|
|
5
|
+
count: resource.errors.count,
|
|
6
|
+
resource: resource.class.model_name.human.downcase)
|
|
7
|
+
%>
|
|
8
|
+
</h2>
|
|
9
|
+
<ul>
|
|
10
|
+
<% resource.errors.full_messages.each do |message| %>
|
|
11
|
+
<li><%= message %></li>
|
|
12
|
+
<% end %>
|
|
13
|
+
</ul>
|
|
14
|
+
</div>
|
|
15
|
+
<% end %>
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
<%- if controller_name != 'sessions' %>
|
|
2
2
|
<%= link_to "Log in", new_session_path(resource_name) %><br />
|
|
3
|
-
<% end
|
|
3
|
+
<% end %>
|
|
4
4
|
|
|
5
5
|
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
|
6
6
|
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
|
|
7
|
-
<% end
|
|
7
|
+
<% end %>
|
|
8
8
|
|
|
9
9
|
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
|
|
10
10
|
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
|
|
11
|
-
<% end
|
|
11
|
+
<% end %>
|
|
12
12
|
|
|
13
13
|
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
|
14
14
|
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
|
|
15
|
-
<% end
|
|
15
|
+
<% end %>
|
|
16
16
|
|
|
17
17
|
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
|
18
18
|
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
|
|
19
|
-
<% end
|
|
19
|
+
<% end %>
|
|
20
20
|
|
|
21
21
|
<%- if devise_mapping.omniauthable? %>
|
|
22
22
|
<%- resource_class.omniauth_providers.each do |provider| %>
|
|
23
|
-
<%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider) %><br />
|
|
24
|
-
<% end
|
|
25
|
-
<% end
|
|
23
|
+
<%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), method: :post %><br />
|
|
24
|
+
<% end %>
|
|
25
|
+
<% end %>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<h2>Resend unlock instructions</h2>
|
|
2
2
|
|
|
3
3
|
<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
|
|
4
|
-
<%=
|
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
|
5
5
|
|
|
6
6
|
<div class="field">
|
|
7
7
|
<%= f.label :email %><br />
|
|
8
|
-
<%= f.email_field :email, autofocus: true %>
|
|
8
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
11
|
<div class="actions">
|
data/config/locales/en.yml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Additional translations at https://github.com/
|
|
1
|
+
# Additional translations at https://github.com/heartcombo/devise/wiki/I18n
|
|
2
2
|
|
|
3
3
|
en:
|
|
4
4
|
devise:
|
|
@@ -23,6 +23,8 @@ en:
|
|
|
23
23
|
subject: "Reset password instructions"
|
|
24
24
|
unlock_instructions:
|
|
25
25
|
subject: "Unlock instructions"
|
|
26
|
+
email_changed:
|
|
27
|
+
subject: "Email Changed"
|
|
26
28
|
password_change:
|
|
27
29
|
subject: "Password Changed"
|
|
28
30
|
omniauth_callbacks:
|
|
@@ -40,8 +42,9 @@ en:
|
|
|
40
42
|
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
|
|
41
43
|
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
|
|
42
44
|
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
|
|
43
|
-
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the
|
|
45
|
+
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirmation link to confirm your new email address."
|
|
44
46
|
updated: "Your account has been updated successfully."
|
|
47
|
+
updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again."
|
|
45
48
|
sessions:
|
|
46
49
|
signed_in: "Signed in successfully."
|
|
47
50
|
signed_out: "Signed out successfully."
|
data/lib/devise.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'rails'
|
|
2
4
|
require 'active_support/core_ext/numeric/time'
|
|
3
5
|
require 'active_support/dependencies'
|
|
@@ -12,19 +14,19 @@ module Devise
|
|
|
12
14
|
autoload :FailureApp, 'devise/failure_app'
|
|
13
15
|
autoload :OmniAuth, 'devise/omniauth'
|
|
14
16
|
autoload :ParameterFilter, 'devise/parameter_filter'
|
|
15
|
-
autoload :BaseSanitizer, 'devise/parameter_sanitizer'
|
|
16
17
|
autoload :ParameterSanitizer, 'devise/parameter_sanitizer'
|
|
17
18
|
autoload :TestHelpers, 'devise/test_helpers'
|
|
18
19
|
autoload :TimeInflector, 'devise/time_inflector'
|
|
19
20
|
autoload :TokenGenerator, 'devise/token_generator'
|
|
21
|
+
autoload :SecretKeyFinder, 'devise/secret_key_finder'
|
|
20
22
|
|
|
21
23
|
module Controllers
|
|
22
|
-
autoload :Helpers,
|
|
23
|
-
autoload :Rememberable,
|
|
24
|
-
autoload :ScopedViews,
|
|
25
|
-
autoload :SignInOut,
|
|
26
|
-
autoload :StoreLocation,
|
|
27
|
-
autoload :UrlHelpers,
|
|
24
|
+
autoload :Helpers, 'devise/controllers/helpers'
|
|
25
|
+
autoload :Rememberable, 'devise/controllers/rememberable'
|
|
26
|
+
autoload :ScopedViews, 'devise/controllers/scoped_views'
|
|
27
|
+
autoload :SignInOut, 'devise/controllers/sign_in_out'
|
|
28
|
+
autoload :StoreLocation, 'devise/controllers/store_location'
|
|
29
|
+
autoload :UrlHelpers, 'devise/controllers/url_helpers'
|
|
28
30
|
end
|
|
29
31
|
|
|
30
32
|
module Hooks
|
|
@@ -36,17 +38,22 @@ module Devise
|
|
|
36
38
|
end
|
|
37
39
|
|
|
38
40
|
module Strategies
|
|
39
|
-
autoload :Base,
|
|
41
|
+
autoload :Base, 'devise/strategies/base'
|
|
40
42
|
autoload :Authenticatable, 'devise/strategies/authenticatable'
|
|
41
43
|
end
|
|
42
44
|
|
|
45
|
+
module Test
|
|
46
|
+
autoload :ControllerHelpers, 'devise/test/controller_helpers'
|
|
47
|
+
autoload :IntegrationHelpers, 'devise/test/integration_helpers'
|
|
48
|
+
end
|
|
49
|
+
|
|
43
50
|
# Constants which holds devise configuration for extensions. Those should
|
|
44
51
|
# not be modified by the "end user" (this is why they are constants).
|
|
45
52
|
ALL = []
|
|
46
|
-
CONTROLLERS =
|
|
47
|
-
ROUTES =
|
|
48
|
-
STRATEGIES =
|
|
49
|
-
URL_HELPERS =
|
|
53
|
+
CONTROLLERS = {}
|
|
54
|
+
ROUTES = {}
|
|
55
|
+
STRATEGIES = {}
|
|
56
|
+
URL_HELPERS = {}
|
|
50
57
|
|
|
51
58
|
# Strategies that do not require user input.
|
|
52
59
|
NO_INPUT = []
|
|
@@ -62,9 +69,9 @@ module Devise
|
|
|
62
69
|
mattr_accessor :rememberable_options
|
|
63
70
|
@@rememberable_options = {}
|
|
64
71
|
|
|
65
|
-
# The number of times to
|
|
72
|
+
# The number of times to hash the password.
|
|
66
73
|
mattr_accessor :stretches
|
|
67
|
-
@@stretches =
|
|
74
|
+
@@stretches = 12
|
|
68
75
|
|
|
69
76
|
# The default key used when authenticating over http auth.
|
|
70
77
|
mattr_accessor :http_authentication_key
|
|
@@ -84,7 +91,7 @@ module Devise
|
|
|
84
91
|
|
|
85
92
|
# Keys that should have whitespace stripped.
|
|
86
93
|
mattr_accessor :strip_whitespace_keys
|
|
87
|
-
@@strip_whitespace_keys = []
|
|
94
|
+
@@strip_whitespace_keys = [:email]
|
|
88
95
|
|
|
89
96
|
# If http authentication is enabled by default.
|
|
90
97
|
mattr_accessor :http_authenticatable
|
|
@@ -102,11 +109,11 @@ module Devise
|
|
|
102
109
|
mattr_accessor :http_authentication_realm
|
|
103
110
|
@@http_authentication_realm = "Application"
|
|
104
111
|
|
|
105
|
-
# Email regex used to validate email formats. It
|
|
106
|
-
#
|
|
107
|
-
#
|
|
112
|
+
# Email regex used to validate email formats. It asserts that there are no
|
|
113
|
+
# @ symbols or whitespaces in either the localpart or the domain, and that
|
|
114
|
+
# there is a single @ symbol separating the localpart and the domain.
|
|
108
115
|
mattr_accessor :email_regexp
|
|
109
|
-
@@email_regexp = /\A[^@\s]+@
|
|
116
|
+
@@email_regexp = /\A[^@\s]+@[^@\s]+\z/
|
|
110
117
|
|
|
111
118
|
# Range validation for password length
|
|
112
119
|
mattr_accessor :password_length
|
|
@@ -138,19 +145,22 @@ module Devise
|
|
|
138
145
|
@@confirmation_keys = [:email]
|
|
139
146
|
|
|
140
147
|
# Defines if email should be reconfirmable.
|
|
141
|
-
# False by default for backwards compatibility.
|
|
142
148
|
mattr_accessor :reconfirmable
|
|
143
|
-
@@reconfirmable =
|
|
149
|
+
@@reconfirmable = true
|
|
144
150
|
|
|
145
151
|
# Time interval to timeout the user session without activity.
|
|
146
152
|
mattr_accessor :timeout_in
|
|
147
153
|
@@timeout_in = 30.minutes
|
|
148
154
|
|
|
149
|
-
# Used to
|
|
155
|
+
# Used to hash the password. Please generate one with rails secret.
|
|
150
156
|
mattr_accessor :pepper
|
|
151
157
|
@@pepper = nil
|
|
152
158
|
|
|
153
|
-
# Used to
|
|
159
|
+
# Used to send notification to the original user email when their email is changed.
|
|
160
|
+
mattr_accessor :send_email_changed_notification
|
|
161
|
+
@@send_email_changed_notification = false
|
|
162
|
+
|
|
163
|
+
# Used to enable sending notification to user when their password is changed.
|
|
154
164
|
mattr_accessor :send_password_change_notification
|
|
155
165
|
@@send_password_change_notification = false
|
|
156
166
|
|
|
@@ -203,7 +213,7 @@ module Devise
|
|
|
203
213
|
|
|
204
214
|
# Skip session storage for the following strategies
|
|
205
215
|
mattr_accessor :skip_session_storage
|
|
206
|
-
@@skip_session_storage = []
|
|
216
|
+
@@skip_session_storage = [:http_auth]
|
|
207
217
|
|
|
208
218
|
# Which formats should be treated as navigational.
|
|
209
219
|
mattr_accessor :navigational_formats
|
|
@@ -215,7 +225,7 @@ module Devise
|
|
|
215
225
|
|
|
216
226
|
# The default method used while signing out
|
|
217
227
|
mattr_accessor :sign_out_via
|
|
218
|
-
@@sign_out_via = :
|
|
228
|
+
@@sign_out_via = :delete
|
|
219
229
|
|
|
220
230
|
# The parent controller all Devise controllers inherits from.
|
|
221
231
|
# Defaults to ApplicationController. This should be set early
|
|
@@ -244,15 +254,22 @@ module Devise
|
|
|
244
254
|
mattr_accessor :clean_up_csrf_token_on_authentication
|
|
245
255
|
@@clean_up_csrf_token_on_authentication = true
|
|
246
256
|
|
|
257
|
+
# When false, Devise will not attempt to reload routes on eager load.
|
|
258
|
+
# This can reduce the time taken to boot the app but if your application
|
|
259
|
+
# requires the Devise mappings to be loaded during boot time the application
|
|
260
|
+
# won't boot properly.
|
|
261
|
+
mattr_accessor :reload_routes
|
|
262
|
+
@@reload_routes = true
|
|
263
|
+
|
|
247
264
|
# PRIVATE CONFIGURATION
|
|
248
265
|
|
|
249
266
|
# Store scopes mappings.
|
|
250
267
|
mattr_reader :mappings
|
|
251
|
-
@@mappings =
|
|
268
|
+
@@mappings = {}
|
|
252
269
|
|
|
253
270
|
# OmniAuth configurations.
|
|
254
271
|
mattr_reader :omniauth_configs
|
|
255
|
-
@@omniauth_configs =
|
|
272
|
+
@@omniauth_configs = {}
|
|
256
273
|
|
|
257
274
|
# Define a set of modules that are called when a mapping is added.
|
|
258
275
|
mattr_reader :helpers
|
|
@@ -276,14 +293,22 @@ module Devise
|
|
|
276
293
|
mattr_accessor :token_generator
|
|
277
294
|
@@token_generator = nil
|
|
278
295
|
|
|
279
|
-
#
|
|
296
|
+
# When set to false, changing a password does not automatically sign in a user
|
|
297
|
+
mattr_accessor :sign_in_after_change_password
|
|
298
|
+
@@sign_in_after_change_password = true
|
|
299
|
+
|
|
300
|
+
def self.activerecord51? # :nodoc:
|
|
301
|
+
defined?(ActiveRecord) && ActiveRecord.gem_version >= Gem::Version.new("5.1.x")
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
# Default way to set up Devise. Run rails generate devise_install to create
|
|
280
305
|
# a fresh initializer with all configuration values.
|
|
281
306
|
def self.setup
|
|
282
307
|
yield self
|
|
283
308
|
end
|
|
284
309
|
|
|
285
310
|
class Getter
|
|
286
|
-
def initialize
|
|
311
|
+
def initialize(name)
|
|
287
312
|
@name = name
|
|
288
313
|
end
|
|
289
314
|
|
|
@@ -293,12 +318,8 @@ module Devise
|
|
|
293
318
|
end
|
|
294
319
|
|
|
295
320
|
def self.ref(arg)
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
Getter.new(arg)
|
|
299
|
-
else
|
|
300
|
-
ActiveSupport::Dependencies.ref(arg)
|
|
301
|
-
end
|
|
321
|
+
ActiveSupport::Dependencies.reference(arg)
|
|
322
|
+
Getter.new(arg)
|
|
302
323
|
end
|
|
303
324
|
|
|
304
325
|
def self.available_router_name
|
|
@@ -419,7 +440,6 @@ module Devise
|
|
|
419
440
|
# config.omniauth :github, APP_ID, APP_SECRET
|
|
420
441
|
#
|
|
421
442
|
def self.omniauth(provider, *args)
|
|
422
|
-
@@helpers << Devise::OmniAuth::UrlHelpers
|
|
423
443
|
config = Devise::OmniAuth::Config.new(provider, args)
|
|
424
444
|
@@omniauth_configs[config.strategy_name.to_sym] = config
|
|
425
445
|
end
|
|
@@ -457,10 +477,7 @@ module Devise
|
|
|
457
477
|
mapping.to.serialize_into_session(record)
|
|
458
478
|
end
|
|
459
479
|
|
|
460
|
-
warden_config.serialize_from_session(mapping.name) do |
|
|
461
|
-
# Previous versions contained an additional entry at the beginning of
|
|
462
|
-
# key with the record's class name.
|
|
463
|
-
args = key[-2, 2]
|
|
480
|
+
warden_config.serialize_from_session(mapping.name) do |args|
|
|
464
481
|
mapping.to.serialize_from_session(*args)
|
|
465
482
|
end
|
|
466
483
|
end
|