devise 3.2.3 → 3.2.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of devise might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +6 -6
- data/README.md +7 -0
- data/Rakefile +1 -1
- data/app/controllers/devise/confirmations_controller.rb +2 -2
- data/app/controllers/devise/omniauth_callbacks_controller.rb +2 -2
- data/app/controllers/devise/passwords_controller.rb +3 -3
- data/app/controllers/devise/registrations_controller.rb +7 -7
- data/app/controllers/devise/sessions_controller.rb +6 -6
- data/app/controllers/devise/unlocks_controller.rb +2 -2
- data/app/controllers/devise_controller.rb +3 -3
- data/app/helpers/devise_helper.rb +2 -2
- data/app/views/devise/confirmations/new.html.erb +2 -2
- data/app/views/devise/mailer/confirmation_instructions.html.erb +1 -1
- data/app/views/devise/mailer/reset_password_instructions.html.erb +1 -1
- data/app/views/devise/mailer/unlock_instructions.html.erb +1 -1
- 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 +6 -6
- data/app/views/devise/registrations/new.html.erb +4 -4
- data/app/views/devise/sessions/new.html.erb +3 -3
- data/app/views/devise/unlocks/new.html.erb +2 -2
- data/devise.gemspec +1 -1
- data/gemfiles/Gemfile.rails-3.2-stable +3 -3
- data/gemfiles/Gemfile.rails-4.0-stable +3 -3
- data/gemfiles/Gemfile.rails-head +3 -3
- data/lib/devise.rb +3 -3
- data/lib/devise/controllers/helpers.rb +5 -5
- data/lib/devise/controllers/rememberable.rb +3 -3
- data/lib/devise/controllers/sign_in_out.rb +8 -8
- data/lib/devise/failure_app.rb +3 -3
- data/lib/devise/hooks/activatable.rb +1 -1
- data/lib/devise/hooks/lockable.rb +1 -1
- data/lib/devise/hooks/proxy.rb +1 -1
- data/lib/devise/hooks/rememberable.rb +1 -1
- data/lib/devise/hooks/timeoutable.rb +1 -1
- data/lib/devise/hooks/trackable.rb +1 -1
- data/lib/devise/mailers/helpers.rb +8 -8
- data/lib/devise/models/authenticatable.rb +3 -3
- data/lib/devise/models/confirmable.rb +9 -9
- data/lib/devise/models/database_authenticatable.rb +1 -1
- data/lib/devise/models/lockable.rb +6 -6
- data/lib/devise/models/omniauthable.rb +1 -1
- data/lib/devise/models/recoverable.rb +1 -1
- data/lib/devise/models/rememberable.rb +3 -3
- data/lib/devise/models/trackable.rb +1 -1
- data/lib/devise/models/validatable.rb +6 -6
- data/lib/devise/modules.rb +9 -9
- data/lib/devise/omniauth/url_helpers.rb +2 -2
- data/lib/devise/rails.rb +1 -1
- data/lib/devise/rails/routes.rb +81 -81
- data/lib/devise/test_helpers.rb +2 -2
- data/lib/devise/time_inflector.rb +1 -1
- data/lib/devise/version.rb +1 -1
- data/lib/generators/active_record/devise_generator.rb +6 -6
- data/lib/generators/active_record/templates/migration.rb +4 -4
- data/lib/generators/active_record/templates/migration_existing.rb +4 -4
- data/lib/generators/devise/devise_generator.rb +3 -3
- data/lib/generators/devise/views_generator.rb +29 -18
- data/lib/generators/mongoid/devise_generator.rb +19 -19
- data/lib/generators/templates/README +2 -2
- data/lib/generators/templates/devise.rb +9 -7
- data/lib/generators/templates/markerb/confirmation_instructions.markerb +1 -1
- data/lib/generators/templates/markerb/reset_password_instructions.markerb +1 -1
- data/lib/generators/templates/markerb/unlock_instructions.markerb +1 -1
- data/lib/generators/templates/simple_form_for/confirmations/new.html.erb +2 -2
- data/lib/generators/templates/simple_form_for/passwords/edit.html.erb +4 -4
- data/lib/generators/templates/simple_form_for/passwords/new.html.erb +2 -2
- data/lib/generators/templates/simple_form_for/registrations/edit.html.erb +6 -6
- data/lib/generators/templates/simple_form_for/registrations/new.html.erb +4 -4
- data/lib/generators/templates/simple_form_for/sessions/new.html.erb +4 -4
- data/lib/generators/templates/simple_form_for/unlocks/new.html.erb +2 -2
- data/test/controllers/helpers_test.rb +31 -31
- data/test/controllers/internal_helpers_test.rb +6 -6
- data/test/controllers/sessions_controller_test.rb +18 -18
- data/test/controllers/url_helpers_test.rb +4 -4
- data/test/delegator_test.rb +1 -1
- data/test/devise_test.rb +3 -3
- data/test/failure_app_test.rb +21 -21
- data/test/generators/active_record_generator_test.rb +4 -4
- data/test/generators/devise_generator_test.rb +2 -2
- data/test/generators/mongoid_generator_test.rb +1 -1
- data/test/generators/views_generator_test.rb +30 -1
- data/test/helpers/devise_helper_test.rb +11 -11
- data/test/integration/authenticatable_test.rb +42 -42
- data/test/integration/confirmable_test.rb +46 -46
- data/test/integration/database_authenticatable_test.rb +16 -16
- data/test/integration/http_authenticatable_test.rb +11 -11
- data/test/integration/lockable_test.rb +37 -37
- data/test/integration/omniauthable_test.rb +3 -3
- data/test/integration/recoverable_test.rb +41 -41
- data/test/integration/registerable_test.rb +49 -49
- data/test/integration/rememberable_test.rb +13 -13
- data/test/integration/timeoutable_test.rb +7 -7
- data/test/integration/trackable_test.rb +2 -2
- data/test/mailers/confirmation_instructions_test.rb +4 -4
- data/test/mailers/reset_password_instructions_test.rb +3 -3
- data/test/mailers/unlock_instructions_test.rb +2 -2
- data/test/models/authenticatable_test.rb +3 -3
- data/test/models/confirmable_test.rb +31 -31
- data/test/models/database_authenticatable_test.rb +27 -27
- data/test/models/lockable_test.rb +29 -29
- data/test/models/recoverable_test.rb +19 -19
- data/test/models/rememberable_test.rb +8 -8
- data/test/models/serializable_test.rb +8 -8
- data/test/models/timeoutable_test.rb +1 -1
- data/test/models/validatable_test.rb +11 -11
- data/test/omniauth/config_test.rb +3 -3
- data/test/omniauth/url_helpers_test.rb +3 -3
- data/test/parameter_sanitizer_test.rb +1 -1
- data/test/rails_app/app/controllers/admins_controller.rb +1 -1
- data/test/rails_app/app/controllers/application_controller.rb +2 -2
- data/test/rails_app/app/controllers/home_controller.rb +1 -1
- data/test/rails_app/app/controllers/users/omniauth_callbacks_controller.rb +2 -2
- data/test/rails_app/app/controllers/users_controller.rb +5 -5
- data/test/rails_app/app/mailers/users/mailer.rb +4 -4
- data/test/rails_app/app/mongoid/admin.rb +11 -11
- data/test/rails_app/app/mongoid/shim.rb +2 -2
- data/test/rails_app/app/mongoid/user.rb +19 -19
- data/test/rails_app/app/views/admins/sessions/new.html.erb +1 -1
- data/test/rails_app/app/views/layouts/application.html.erb +1 -1
- data/test/rails_app/config/application.rb +2 -2
- data/test/rails_app/config/initializers/devise.rb +3 -3
- data/test/rails_app/config/initializers/secret_token.rb +1 -1
- data/test/rails_app/config/routes.rb +43 -43
- data/test/rails_app/db/migrate/20100401102949_create_tables.rb +7 -7
- data/test/rails_app/lib/shared_admin.rb +4 -4
- data/test/routes_test.rb +59 -59
- data/test/support/helpers.rb +4 -4
- data/test/support/integration.rb +12 -12
- data/test/test_helpers_test.rb +3 -3
- data/test/test_models.rb +5 -5
- metadata +4 -4
data/lib/devise/test_helpers.rb
CHANGED
@@ -109,8 +109,8 @@ module Devise
|
|
109
109
|
|
110
110
|
status, headers, response = Devise.warden_config[:failure_app].call(env).to_a
|
111
111
|
@controller.response.headers.merge!(headers)
|
112
|
-
@controller.send :render, :
|
113
|
-
:
|
112
|
+
@controller.send :render, status: status, text: response.body,
|
113
|
+
content_type: headers["Content-Type"], location: headers["Location"]
|
114
114
|
nil # causes process return @response
|
115
115
|
end
|
116
116
|
|
data/lib/devise/version.rb
CHANGED
@@ -4,7 +4,7 @@ require 'generators/devise/orm_helpers'
|
|
4
4
|
module ActiveRecord
|
5
5
|
module Generators
|
6
6
|
class DeviseGenerator < ActiveRecord::Generators::Base
|
7
|
-
argument :attributes, :
|
7
|
+
argument :attributes, type: :array, default: [], banner: "field:type field:type"
|
8
8
|
|
9
9
|
include Devise::Generators::OrmHelpers
|
10
10
|
source_root File.expand_path("../templates", __FILE__)
|
@@ -18,7 +18,7 @@ module ActiveRecord
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def generate_model
|
21
|
-
invoke "active_record:model", [name], :
|
21
|
+
invoke "active_record:model", [name], migration: false unless model_exists? && behavior == :invoke
|
22
22
|
end
|
23
23
|
|
24
24
|
def inject_devise_content
|
@@ -39,8 +39,8 @@ module ActiveRecord
|
|
39
39
|
def migration_data
|
40
40
|
<<RUBY
|
41
41
|
## Database authenticatable
|
42
|
-
t.string :email, :
|
43
|
-
t.string :encrypted_password, :
|
42
|
+
t.string :email, null: false, default: ""
|
43
|
+
t.string :encrypted_password, null: false, default: ""
|
44
44
|
|
45
45
|
## Recoverable
|
46
46
|
t.string :reset_password_token
|
@@ -50,7 +50,7 @@ module ActiveRecord
|
|
50
50
|
t.datetime :remember_created_at
|
51
51
|
|
52
52
|
## Trackable
|
53
|
-
t.integer :sign_in_count, :
|
53
|
+
t.integer :sign_in_count, default: 0, null: false
|
54
54
|
t.datetime :current_sign_in_at
|
55
55
|
t.datetime :last_sign_in_at
|
56
56
|
t.string :current_sign_in_ip
|
@@ -63,7 +63,7 @@ module ActiveRecord
|
|
63
63
|
# t.string :unconfirmed_email # Only if using reconfirmable
|
64
64
|
|
65
65
|
## Lockable
|
66
|
-
# t.integer :failed_attempts, :
|
66
|
+
# t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
|
67
67
|
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
68
68
|
# t.datetime :locked_at
|
69
69
|
RUBY
|
@@ -10,9 +10,9 @@ class DeviseCreate<%= table_name.camelize %> < ActiveRecord::Migration
|
|
10
10
|
t.timestamps
|
11
11
|
end
|
12
12
|
|
13
|
-
add_index :<%= table_name %>, :email, :
|
14
|
-
add_index :<%= table_name %>, :reset_password_token, :
|
15
|
-
# add_index :<%= table_name %>, :confirmation_token, :
|
16
|
-
# add_index :<%= table_name %>, :unlock_token, :
|
13
|
+
add_index :<%= table_name %>, :email, unique: true
|
14
|
+
add_index :<%= table_name %>, :reset_password_token, unique: true
|
15
|
+
# add_index :<%= table_name %>, :confirmation_token, unique: true
|
16
|
+
# add_index :<%= table_name %>, :unlock_token, unique: true
|
17
17
|
end
|
18
18
|
end
|
@@ -11,10 +11,10 @@ class AddDeviseTo<%= table_name.camelize %> < ActiveRecord::Migration
|
|
11
11
|
# t.timestamps
|
12
12
|
end
|
13
13
|
|
14
|
-
add_index :<%= table_name %>, :email, :
|
15
|
-
add_index :<%= table_name %>, :reset_password_token, :
|
16
|
-
# add_index :<%= table_name %>, :confirmation_token, :
|
17
|
-
# add_index :<%= table_name %>, :unlock_token, :
|
14
|
+
add_index :<%= table_name %>, :email, unique: true
|
15
|
+
add_index :<%= table_name %>, :reset_password_token, unique: true
|
16
|
+
# add_index :<%= table_name %>, :confirmation_token, unique: true
|
17
|
+
# add_index :<%= table_name %>, :unlock_token, unique: true
|
18
18
|
end
|
19
19
|
|
20
20
|
def self.down
|
@@ -13,12 +13,12 @@ module Devise
|
|
13
13
|
|
14
14
|
hook_for :orm
|
15
15
|
|
16
|
-
class_option :routes, :
|
16
|
+
class_option :routes, desc: "Generate routes", type: :boolean, default: true
|
17
17
|
|
18
18
|
def add_devise_routes
|
19
19
|
devise_route = "devise_for :#{plural_name}"
|
20
|
-
devise_route << %Q(, :
|
21
|
-
devise_route << %Q(, :
|
20
|
+
devise_route << %Q(, class_name: "#{class_name}") if class_name.include?("::")
|
21
|
+
devise_route << %Q(, skip: :all) unless options.routes?
|
22
22
|
route devise_route
|
23
23
|
end
|
24
24
|
end
|
@@ -9,13 +9,14 @@ module Devise
|
|
9
9
|
extend ActiveSupport::Concern
|
10
10
|
|
11
11
|
included do
|
12
|
-
argument :scope, :
|
13
|
-
:
|
12
|
+
argument :scope, required: false, default: nil,
|
13
|
+
desc: "The scope to copy views to"
|
14
14
|
|
15
15
|
# Le sigh, ensure Thor won't handle opts as args
|
16
16
|
# It should be fixed in future Rails releases
|
17
|
-
class_option :form_builder, :
|
17
|
+
class_option :form_builder, aliases: "-b"
|
18
18
|
class_option :markerb
|
19
|
+
class_option :views, aliases: "-v", type: :array, desc: "Select specific view directories to generate (confirmations, passwords, registrations, sessions, unlocks, mailer)"
|
19
20
|
|
20
21
|
public_task :copy_views
|
21
22
|
end
|
@@ -28,11 +29,17 @@ module Devise
|
|
28
29
|
end
|
29
30
|
|
30
31
|
def copy_views
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
if options[:views]
|
33
|
+
options[:views].each do |directory|
|
34
|
+
view_directory directory.to_sym
|
35
|
+
end
|
36
|
+
else
|
37
|
+
view_directory :confirmations
|
38
|
+
view_directory :passwords
|
39
|
+
view_directory :registrations
|
40
|
+
view_directory :sessions
|
41
|
+
view_directory :unlocks
|
42
|
+
end
|
36
43
|
end
|
37
44
|
|
38
45
|
protected
|
@@ -85,7 +92,9 @@ module Devise
|
|
85
92
|
hide!
|
86
93
|
|
87
94
|
def copy_views
|
88
|
-
|
95
|
+
if !options[:views] || options[:views].include?('mailer')
|
96
|
+
view_directory :mailer
|
97
|
+
end
|
89
98
|
end
|
90
99
|
end
|
91
100
|
|
@@ -96,7 +105,9 @@ module Devise
|
|
96
105
|
hide!
|
97
106
|
|
98
107
|
def copy_views
|
99
|
-
|
108
|
+
if !options[:views] || options[:views].include?('mailer')
|
109
|
+
view_directory :markerb, target_path
|
110
|
+
end
|
100
111
|
end
|
101
112
|
|
102
113
|
def target_path
|
@@ -107,18 +118,18 @@ module Devise
|
|
107
118
|
class ViewsGenerator < Rails::Generators::Base
|
108
119
|
desc "Copies Devise views to your application."
|
109
120
|
|
110
|
-
argument :scope, :
|
111
|
-
:
|
121
|
+
argument :scope, required: false, default: nil,
|
122
|
+
desc: "The scope to copy views to"
|
112
123
|
|
113
124
|
invoke SharedViewsGenerator
|
114
125
|
|
115
|
-
hook_for :form_builder, :
|
116
|
-
:
|
117
|
-
:
|
126
|
+
hook_for :form_builder, aliases: "-b",
|
127
|
+
desc: "Form builder to be used",
|
128
|
+
default: defined?(SimpleForm) ? "simple_form_for" : "form_for"
|
118
129
|
|
119
|
-
hook_for :markerb, :
|
120
|
-
:
|
121
|
-
:
|
130
|
+
hook_for :markerb, desc: "Generate markerb instead of erb mail views",
|
131
|
+
default: defined?(Markerb) ? :markerb : :erb,
|
132
|
+
type: :boolean
|
122
133
|
end
|
123
134
|
end
|
124
135
|
end
|
@@ -11,43 +11,43 @@ module Mongoid
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def inject_field_types
|
14
|
-
inject_into_file model_path, migration_data, :
|
14
|
+
inject_into_file model_path, migration_data, after: "include Mongoid::Document\n" if model_exists?
|
15
15
|
end
|
16
16
|
|
17
17
|
def inject_devise_content
|
18
|
-
inject_into_file model_path, model_contents, :
|
18
|
+
inject_into_file model_path, model_contents, after: "include Mongoid::Document\n" if model_exists?
|
19
19
|
end
|
20
20
|
|
21
21
|
def migration_data
|
22
22
|
<<RUBY
|
23
23
|
## Database authenticatable
|
24
|
-
field :email, :
|
25
|
-
field :encrypted_password, :
|
24
|
+
field :email, type: String, default: ""
|
25
|
+
field :encrypted_password, type: String, default: ""
|
26
26
|
|
27
27
|
## Recoverable
|
28
|
-
field :reset_password_token, :
|
29
|
-
field :reset_password_sent_at, :
|
28
|
+
field :reset_password_token, type: String
|
29
|
+
field :reset_password_sent_at, type: Time
|
30
30
|
|
31
31
|
## Rememberable
|
32
|
-
field :remember_created_at, :
|
32
|
+
field :remember_created_at, type: Time
|
33
33
|
|
34
34
|
## Trackable
|
35
|
-
field :sign_in_count, :
|
36
|
-
field :current_sign_in_at, :
|
37
|
-
field :last_sign_in_at, :
|
38
|
-
field :current_sign_in_ip, :
|
39
|
-
field :last_sign_in_ip, :
|
35
|
+
field :sign_in_count, type: Integer, default: 0
|
36
|
+
field :current_sign_in_at, type: Time
|
37
|
+
field :last_sign_in_at, type: Time
|
38
|
+
field :current_sign_in_ip, type: String
|
39
|
+
field :last_sign_in_ip, type: String
|
40
40
|
|
41
41
|
## Confirmable
|
42
|
-
# field :confirmation_token, :
|
43
|
-
# field :confirmed_at, :
|
44
|
-
# field :confirmation_sent_at, :
|
45
|
-
# field :unconfirmed_email, :
|
42
|
+
# field :confirmation_token, type: String
|
43
|
+
# field :confirmed_at, type: Time
|
44
|
+
# field :confirmation_sent_at, type: Time
|
45
|
+
# field :unconfirmed_email, type: String # Only if using reconfirmable
|
46
46
|
|
47
47
|
## Lockable
|
48
|
-
# field :failed_attempts, :
|
49
|
-
# field :unlock_token, :
|
50
|
-
# field :locked_at, :
|
48
|
+
# field :failed_attempts, type: Integer, default: 0 # Only if lock strategy is :failed_attempts
|
49
|
+
# field :unlock_token, type: String # Only if unlock strategy is :email or :both
|
50
|
+
# field :locked_at, type: Time
|
51
51
|
RUBY
|
52
52
|
end
|
53
53
|
end
|
@@ -6,14 +6,14 @@ Some setup you must do manually if you haven't yet:
|
|
6
6
|
is an example of default_url_options appropriate for a development environment
|
7
7
|
in config/environments/development.rb:
|
8
8
|
|
9
|
-
config.action_mailer.default_url_options = { :
|
9
|
+
config.action_mailer.default_url_options = { host: 'localhost:3000' }
|
10
10
|
|
11
11
|
In production, :host should be set to the actual host of your application.
|
12
12
|
|
13
13
|
2. Ensure you have defined root_url to *something* in your config/routes.rb.
|
14
14
|
For example:
|
15
15
|
|
16
|
-
root :
|
16
|
+
root to: "home#index"
|
17
17
|
|
18
18
|
3. Ensure you have flash messages in app/views/layouts/application.html.erb.
|
19
19
|
For example:
|
@@ -80,7 +80,7 @@ Devise.setup do |config|
|
|
80
80
|
# particular strategies by setting this option.
|
81
81
|
# Notice that if you are skipping storage for all authentication paths, you
|
82
82
|
# may want to disable generating routes to Devise's sessions controller by
|
83
|
-
# passing :
|
83
|
+
# passing skip: :sessions to `devise_for` in your config/routes.rb
|
84
84
|
config.skip_session_storage = [:http_auth]
|
85
85
|
|
86
86
|
# By default, Devise cleans up the CSRF token on authentication to
|
@@ -95,7 +95,9 @@ Devise.setup do |config|
|
|
95
95
|
#
|
96
96
|
# Limiting the stretches to just one in testing will increase the performance of
|
97
97
|
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
98
|
-
# a value less than 10 in other environments.
|
98
|
+
# a value less than 10 in other environments. Note that, for bcrypt (the default
|
99
|
+
# encryptor), the cost increases exponentially with the number of stretches (e.g.
|
100
|
+
# a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
|
99
101
|
config.stretches = Rails.env.test? ? 1 : 10
|
100
102
|
|
101
103
|
# Setup a pepper to generate the encrypted password.
|
@@ -119,8 +121,8 @@ Devise.setup do |config|
|
|
119
121
|
|
120
122
|
# If true, requires any email changes to be confirmed (exactly the same way as
|
121
123
|
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
122
|
-
# db field (see migrations). Until confirmed new email is stored in
|
123
|
-
#
|
124
|
+
# db field (see migrations). Until confirmed, new email is stored in
|
125
|
+
# unconfirmed_email column, and copied to email column on successful confirmation.
|
124
126
|
config.reconfirmable = true
|
125
127
|
|
126
128
|
# Defines which key will be used when confirming an account
|
@@ -134,7 +136,7 @@ Devise.setup do |config|
|
|
134
136
|
# config.extend_remember_period = false
|
135
137
|
|
136
138
|
# Options to be passed to the created cookie. For instance, you can set
|
137
|
-
# :
|
139
|
+
# secure: true in order to force SSL only cookies.
|
138
140
|
# config.rememberable_options = {}
|
139
141
|
|
140
142
|
# ==> Configuration for :validatable
|
@@ -231,7 +233,7 @@ Devise.setup do |config|
|
|
231
233
|
# ==> OmniAuth
|
232
234
|
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
233
235
|
# up on your models and hooks.
|
234
|
-
# config.omniauth :github, 'APP_ID', 'APP_SECRET', :
|
236
|
+
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
|
235
237
|
|
236
238
|
# ==> Warden configuration
|
237
239
|
# If you want to use other strategies, that are not supported by Devise, or
|
@@ -239,7 +241,7 @@ Devise.setup do |config|
|
|
239
241
|
#
|
240
242
|
# config.warden do |manager|
|
241
243
|
# manager.intercept_401 = false
|
242
|
-
# manager.default_strategies(:
|
244
|
+
# manager.default_strategies(scope: :user).unshift :some_external_strategy
|
243
245
|
# end
|
244
246
|
|
245
247
|
# ==> Mountable engine configurations
|
@@ -2,4 +2,4 @@ Welcome <%= @email %>!
|
|
2
2
|
|
3
3
|
You can confirm your account through the link below:
|
4
4
|
|
5
|
-
<%= link_to 'Confirm my account', confirmation_url(@resource, :
|
5
|
+
<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>
|
@@ -2,7 +2,7 @@ Hello <%= @resource.email %>!
|
|
2
2
|
|
3
3
|
Someone has requested a link to change your password, and you can do this through the link below.
|
4
4
|
|
5
|
-
<%= link_to 'Change my password', edit_password_url(@resource, :
|
5
|
+
<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>
|
6
6
|
|
7
7
|
If you didn't request this, please ignore this email.
|
8
8
|
Your password won't change until you access the link above and create a new one.
|
@@ -4,4 +4,4 @@ Your account has been locked due to an excessive number of unsuccessful sign in
|
|
4
4
|
|
5
5
|
Click the link below to unlock your account:
|
6
6
|
|
7
|
-
<%= link_to 'Unlock my account', unlock_url(@resource, :
|
7
|
+
<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>
|
@@ -1,11 +1,11 @@
|
|
1
1
|
<h2>Resend confirmation instructions</h2>
|
2
2
|
|
3
|
-
<%= simple_form_for(resource, :
|
3
|
+
<%= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
|
4
4
|
<%= f.error_notification %>
|
5
5
|
<%= f.full_error :confirmation_token %>
|
6
6
|
|
7
7
|
<div class="form-inputs">
|
8
|
-
<%= f.input :email, :
|
8
|
+
<%= f.input :email, required: true, autofocus: true %>
|
9
9
|
</div>
|
10
10
|
|
11
11
|
<div class="form-actions">
|
@@ -1,14 +1,14 @@
|
|
1
1
|
<h2>Change your password</h2>
|
2
2
|
|
3
|
-
<%= simple_form_for(resource, :
|
3
|
+
<%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
|
4
4
|
<%= f.error_notification %>
|
5
5
|
|
6
|
-
<%= f.input :reset_password_token, :
|
6
|
+
<%= f.input :reset_password_token, as: :hidden %>
|
7
7
|
<%= f.full_error :reset_password_token %>
|
8
8
|
|
9
9
|
<div class="form-inputs">
|
10
|
-
<%= f.input :password, :
|
11
|
-
<%= f.input :password_confirmation, :
|
10
|
+
<%= f.input :password, label: "New password", required: true, autofocus: true %>
|
11
|
+
<%= f.input :password_confirmation, label: "Confirm your new password", required: true %>
|
12
12
|
</div>
|
13
13
|
|
14
14
|
<div class="form-actions">
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<h2>Forgot your password?</h2>
|
2
2
|
|
3
|
-
<%= simple_form_for(resource, :
|
3
|
+
<%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
|
4
4
|
<%= f.error_notification %>
|
5
5
|
|
6
6
|
<div class="form-inputs">
|
7
|
-
<%= f.input :email, :
|
7
|
+
<%= f.input :email, required: true, autofocus: true %>
|
8
8
|
</div>
|
9
9
|
|
10
10
|
<div class="form-actions">
|
@@ -1,18 +1,18 @@
|
|
1
1
|
<h2>Edit <%= resource_name.to_s.humanize %></h2>
|
2
2
|
|
3
|
-
<%= simple_form_for(resource, :
|
3
|
+
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
4
4
|
<%= f.error_notification %>
|
5
5
|
|
6
6
|
<div class="form-inputs">
|
7
|
-
<%= f.input :email, :
|
7
|
+
<%= f.input :email, required: true, autofocus: true %>
|
8
8
|
|
9
9
|
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
10
10
|
<p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p>
|
11
11
|
<% end %>
|
12
12
|
|
13
|
-
<%= f.input :password, :
|
14
|
-
<%= f.input :password_confirmation, :
|
15
|
-
<%= f.input :current_password, :
|
13
|
+
<%= f.input :password, autocomplete: "off", hint: "leave it blank if you don't want to change it", required: false %>
|
14
|
+
<%= f.input :password_confirmation, required: false %>
|
15
|
+
<%= f.input :current_password, hint: "we need your current password to confirm your changes", required: true %>
|
16
16
|
</div>
|
17
17
|
|
18
18
|
<div class="form-actions">
|
@@ -22,6 +22,6 @@
|
|
22
22
|
|
23
23
|
<h3>Cancel my account</h3>
|
24
24
|
|
25
|
-
<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :
|
25
|
+
<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p>
|
26
26
|
|
27
27
|
<%= link_to "Back", :back %>
|