devise 4.9.3 → 5.0.3
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 +4 -4
- data/CHANGELOG.md +55 -374
- data/MIT-LICENSE +2 -2
- data/README.md +53 -49
- data/app/controllers/devise/confirmations_controller.rb +1 -1
- data/app/controllers/devise/passwords_controller.rb +7 -2
- data/app/controllers/devise/registrations_controller.rb +11 -10
- data/app/controllers/devise/sessions_controller.rb +5 -5
- data/app/controllers/devise/unlocks_controller.rb +1 -1
- data/app/helpers/devise_helper.rb +1 -26
- data/app/views/devise/confirmations/new.html.erb +2 -2
- data/app/views/devise/passwords/edit.html.erb +5 -5
- data/app/views/devise/passwords/new.html.erb +3 -3
- data/app/views/devise/registrations/edit.html.erb +9 -10
- data/app/views/devise/registrations/new.html.erb +8 -8
- data/app/views/devise/sessions/new.html.erb +6 -6
- data/app/views/devise/shared/_error_messages.html.erb +1 -1
- data/app/views/devise/shared/_links.html.erb +6 -6
- data/app/views/devise/unlocks/new.html.erb +2 -2
- data/lib/devise/controllers/helpers.rb +2 -0
- data/lib/devise/controllers/sign_in_out.rb +1 -16
- data/lib/devise/failure_app.rb +23 -24
- data/lib/devise/hooks/activatable.rb +1 -1
- data/lib/devise/hooks/timeoutable.rb +1 -1
- data/lib/devise/mailers/helpers.rb +9 -15
- data/lib/devise/mapping.rb +1 -1
- data/lib/devise/models/authenticatable.rb +2 -14
- data/lib/devise/models/confirmable.rb +3 -1
- data/lib/devise/models/database_authenticatable.rb +6 -24
- data/lib/devise/models/lockable.rb +1 -1
- data/lib/devise/models/validatable.rb +3 -1
- data/lib/devise/orm.rb +21 -12
- data/lib/devise/parameter_sanitizer.rb +1 -2
- data/lib/devise/rails/routes.rb +3 -4
- data/lib/devise/rails.rb +7 -1
- data/lib/devise/test/controller_helpers.rb +1 -12
- data/lib/devise/version.rb +1 -1
- data/lib/devise.rb +12 -20
- data/lib/generators/active_record/devise_generator.rb +5 -11
- data/lib/generators/devise/controllers_generator.rb +1 -1
- data/lib/generators/templates/devise.rb +7 -4
- data/lib/generators/templates/simple_form_for/passwords/new.html.erb +1 -1
- metadata +7 -16
- data/lib/devise/rails/deprecated_constant_accessor.rb +0 -39
- data/lib/devise/secret_key_finder.rb +0 -27
- data/lib/devise/test_helpers.rb +0 -15
|
@@ -157,6 +157,9 @@ Devise.setup do |config|
|
|
|
157
157
|
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
|
158
158
|
# db field (see migrations). Until confirmed, new email is stored in
|
|
159
159
|
# unconfirmed_email column, and copied to email column on successful confirmation.
|
|
160
|
+
# Also, when used in conjunction with `send_email_changed_notification`,
|
|
161
|
+
# the notification is sent to the original email when the change is requested,
|
|
162
|
+
# not when the unconfirmed email is confirmed.
|
|
160
163
|
config.reconfirmable = true
|
|
161
164
|
|
|
162
165
|
# Defines which key will be used when confirming an account
|
|
@@ -277,9 +280,9 @@ Devise.setup do |config|
|
|
|
277
280
|
# If you want to use other strategies, that are not supported by Devise, or
|
|
278
281
|
# change the failure app, you can configure them inside the config.warden block.
|
|
279
282
|
#
|
|
280
|
-
# config.warden do |
|
|
281
|
-
#
|
|
282
|
-
#
|
|
283
|
+
# config.warden do |warden_config|
|
|
284
|
+
# warden_config.intercept_401 = false
|
|
285
|
+
# warden_config.default_strategies(scope: :user).unshift :some_external_strategy
|
|
283
286
|
# end
|
|
284
287
|
|
|
285
288
|
# ==> Mountable engine configurations
|
|
@@ -302,7 +305,7 @@ Devise.setup do |config|
|
|
|
302
305
|
# apps is `200 OK` and `302 Found` respectively, but new apps are generated with
|
|
303
306
|
# these new defaults that match Hotwire/Turbo behavior.
|
|
304
307
|
# Note: These might become the new default in future versions of Devise.
|
|
305
|
-
config.responder.error_status =
|
|
308
|
+
config.responder.error_status = <%= Rack::Utils::SYMBOL_TO_STATUS_CODE.key(422).inspect %>
|
|
306
309
|
config.responder.redirect_status = :see_other
|
|
307
310
|
|
|
308
311
|
# ==> Configuration for :registerable
|
metadata
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: devise
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 5.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- José Valim
|
|
8
8
|
- Carlos Antônio
|
|
9
|
-
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: warden
|
|
@@ -59,14 +58,14 @@ dependencies:
|
|
|
59
58
|
requirements:
|
|
60
59
|
- - ">="
|
|
61
60
|
- !ruby/object:Gem::Version
|
|
62
|
-
version:
|
|
61
|
+
version: '7.0'
|
|
63
62
|
type: :runtime
|
|
64
63
|
prerelease: false
|
|
65
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
66
65
|
requirements:
|
|
67
66
|
- - ">="
|
|
68
67
|
- !ruby/object:Gem::Version
|
|
69
|
-
version:
|
|
68
|
+
version: '7.0'
|
|
70
69
|
- !ruby/object:Gem::Dependency
|
|
71
70
|
name: responders
|
|
72
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -82,7 +81,7 @@ dependencies:
|
|
|
82
81
|
- !ruby/object:Gem::Version
|
|
83
82
|
version: '0'
|
|
84
83
|
description: Flexible authentication solution for Rails with Warden
|
|
85
|
-
email: heartcombo@
|
|
84
|
+
email: heartcombo.oss@gmail.com
|
|
86
85
|
executables: []
|
|
87
86
|
extensions: []
|
|
88
87
|
extra_rdoc_files: []
|
|
@@ -157,17 +156,14 @@ files:
|
|
|
157
156
|
- lib/devise/parameter_filter.rb
|
|
158
157
|
- lib/devise/parameter_sanitizer.rb
|
|
159
158
|
- lib/devise/rails.rb
|
|
160
|
-
- lib/devise/rails/deprecated_constant_accessor.rb
|
|
161
159
|
- lib/devise/rails/routes.rb
|
|
162
160
|
- lib/devise/rails/warden_compat.rb
|
|
163
|
-
- lib/devise/secret_key_finder.rb
|
|
164
161
|
- lib/devise/strategies/authenticatable.rb
|
|
165
162
|
- lib/devise/strategies/base.rb
|
|
166
163
|
- lib/devise/strategies/database_authenticatable.rb
|
|
167
164
|
- lib/devise/strategies/rememberable.rb
|
|
168
165
|
- lib/devise/test/controller_helpers.rb
|
|
169
166
|
- lib/devise/test/integration_helpers.rb
|
|
170
|
-
- lib/devise/test_helpers.rb
|
|
171
167
|
- lib/devise/time_inflector.rb
|
|
172
168
|
- lib/devise/token_generator.rb
|
|
173
169
|
- lib/devise/version.rb
|
|
@@ -211,10 +207,6 @@ metadata:
|
|
|
211
207
|
source_code_uri: https://github.com/heartcombo/devise
|
|
212
208
|
bug_tracker_uri: https://github.com/heartcombo/devise/issues
|
|
213
209
|
wiki_uri: https://github.com/heartcombo/devise/wiki
|
|
214
|
-
post_install_message: "\n[DEVISE] Please review the [changelog] and [upgrade guide]
|
|
215
|
-
for more info on Hotwire / Turbo integration.\n\n [changelog] https://github.com/heartcombo/devise/blob/main/CHANGELOG.md\n
|
|
216
|
-
\ [upgrade guide] https://github.com/heartcombo/devise/wiki/How-To:-Upgrade-to-Devise-4.9.0-%5BHotwire-Turbo-integration%5D\n
|
|
217
|
-
\ "
|
|
218
210
|
rdoc_options: []
|
|
219
211
|
require_paths:
|
|
220
212
|
- lib
|
|
@@ -222,15 +214,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
222
214
|
requirements:
|
|
223
215
|
- - ">="
|
|
224
216
|
- !ruby/object:Gem::Version
|
|
225
|
-
version: 2.
|
|
217
|
+
version: 2.7.0
|
|
226
218
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
227
219
|
requirements:
|
|
228
220
|
- - ">="
|
|
229
221
|
- !ruby/object:Gem::Version
|
|
230
222
|
version: '0'
|
|
231
223
|
requirements: []
|
|
232
|
-
rubygems_version:
|
|
233
|
-
signing_key:
|
|
224
|
+
rubygems_version: 4.0.6
|
|
234
225
|
specification_version: 4
|
|
235
226
|
summary: Flexible authentication solution for Rails with Warden
|
|
236
227
|
test_files: []
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
begin
|
|
4
|
-
require 'active_support/deprecation/constant_accessor'
|
|
5
|
-
|
|
6
|
-
module Devise
|
|
7
|
-
DeprecatedConstantAccessor = ActiveSupport::Deprecation::DeprecatedConstantAccessor #:nodoc:
|
|
8
|
-
end
|
|
9
|
-
rescue LoadError
|
|
10
|
-
|
|
11
|
-
# Copy of constant deprecation module from Rails / Active Support version 6, so we can use it
|
|
12
|
-
# with Rails <= 5.0 versions. This can be removed once we support only Rails 5.1 or greater.
|
|
13
|
-
module Devise
|
|
14
|
-
module DeprecatedConstantAccessor #:nodoc:
|
|
15
|
-
def self.included(base)
|
|
16
|
-
require "active_support/inflector/methods"
|
|
17
|
-
|
|
18
|
-
extension = Module.new do
|
|
19
|
-
def const_missing(missing_const_name)
|
|
20
|
-
if class_variable_defined?(:@@_deprecated_constants)
|
|
21
|
-
if (replacement = class_variable_get(:@@_deprecated_constants)[missing_const_name.to_s])
|
|
22
|
-
replacement[:deprecator].warn(replacement[:message] || "#{name}::#{missing_const_name} is deprecated! Use #{replacement[:new]} instead.", Rails::VERSION::MAJOR == 4 ? caller : caller_locations)
|
|
23
|
-
return ActiveSupport::Inflector.constantize(replacement[:new].to_s)
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
super
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def deprecate_constant(const_name, new_constant, message: nil, deprecator: Devise.deprecator)
|
|
30
|
-
class_variable_set(:@@_deprecated_constants, {}) unless class_variable_defined?(:@@_deprecated_constants)
|
|
31
|
-
class_variable_get(:@@_deprecated_constants)[const_name.to_s] = { new: new_constant, message: message, deprecator: deprecator }
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
base.singleton_class.prepend extension
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
end
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Devise
|
|
4
|
-
class SecretKeyFinder
|
|
5
|
-
def initialize(application)
|
|
6
|
-
@application = application
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
def find
|
|
10
|
-
if @application.respond_to?(:credentials) && key_exists?(@application.credentials)
|
|
11
|
-
@application.credentials.secret_key_base
|
|
12
|
-
elsif @application.respond_to?(:secrets) && key_exists?(@application.secrets)
|
|
13
|
-
@application.secrets.secret_key_base
|
|
14
|
-
elsif @application.config.respond_to?(:secret_key_base) && key_exists?(@application.config)
|
|
15
|
-
@application.config.secret_key_base
|
|
16
|
-
elsif @application.respond_to?(:secret_key_base) && key_exists?(@application)
|
|
17
|
-
@application.secret_key_base
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
private
|
|
22
|
-
|
|
23
|
-
def key_exists?(object)
|
|
24
|
-
object.secret_key_base.present?
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
data/lib/devise/test_helpers.rb
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Devise
|
|
4
|
-
module TestHelpers
|
|
5
|
-
def self.included(base)
|
|
6
|
-
base.class_eval do
|
|
7
|
-
Devise.deprecator.warn <<-DEPRECATION.strip_heredoc
|
|
8
|
-
[Devise] including `Devise::TestHelpers` is deprecated and will be removed from Devise.
|
|
9
|
-
For controller tests, please include `Devise::Test::ControllerHelpers` instead.
|
|
10
|
-
DEPRECATION
|
|
11
|
-
include Devise::Test::ControllerHelpers
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|