mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Fix regression where warden was being configured too early.
This commit is contained in:
parent
a0a141b457
commit
fc3af50b55
2 changed files with 4 additions and 8 deletions
|
@ -87,8 +87,6 @@ module Devise
|
|||
end
|
||||
|
||||
config.after_initialize do
|
||||
Devise.configure_warden!
|
||||
|
||||
example = <<-YAML
|
||||
en:
|
||||
devise:
|
||||
|
|
|
@ -7,11 +7,8 @@ module ActionDispatch::Routing
|
|||
def finalize_with_devise!
|
||||
result = finalize_without_devise!
|
||||
|
||||
# If @devise_finalized was defined, it means devise_for was invoked
|
||||
# in this router, so we proceed to generate devise helpers unless
|
||||
# they were already defined (which then @devise_finalizd would be true).
|
||||
if defined?(@devise_finalized) && !@devise_finalized
|
||||
if Devise.router_name.nil? && self != Rails.application.try(:routes)
|
||||
@devise_finalized ||= begin
|
||||
if Devise.router_name.nil? && defined?(@devise_finalized) && self != Rails.application.try(:routes)
|
||||
warn "[DEVISE] We have detected that you are using devise_for inside engine routes. " \
|
||||
"In this case, you probably want to set Devise.router_name = MOUNT_POINT, where " \
|
||||
"MOUNT_POINT is a symbol representing where this engine will be mounted at. For " \
|
||||
|
@ -19,8 +16,9 @@ module ActionDispatch::Routing
|
|||
" to :main_app as well in case you want to keep the current behavior."
|
||||
end
|
||||
|
||||
Devise.configure_warden!
|
||||
Devise.regenerate_helpers!
|
||||
@devise_finalized = true
|
||||
true
|
||||
end
|
||||
|
||||
result
|
||||
|
|
Loading…
Reference in a new issue