mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
fixed bug 'Could not find a valid mapping for path /users/auth/:provider/callback' when devise_for called inside scope
This commit is contained in:
parent
d8f33b8925
commit
c429fe8d1c
2 changed files with 3 additions and 3 deletions
|
@ -40,8 +40,8 @@ module Devise
|
|||
raise "Could not find a valid mapping for #{duck}"
|
||||
end
|
||||
|
||||
def self.find_by_path!(path)
|
||||
Devise.mappings.each_value { |m| return m if path.include?(m.fullpath) }
|
||||
def self.find_by_path!(path, path_type=:fullpath)
|
||||
Devise.mappings.each_value { |m| return m if path.include?(m.send(path_type)) }
|
||||
raise "Could not find a valid mapping for path #{path}"
|
||||
end
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ end
|
|||
OmniAuth.config.path_prefix = nil
|
||||
|
||||
OmniAuth.config.on_failure = Proc.new do |env, key|
|
||||
env['devise.mapping'] = Devise::Mapping.find_by_path!(env['PATH_INFO'])
|
||||
env['devise.mapping'] = Devise::Mapping.find_by_path!(env['PATH_INFO'], :path)
|
||||
controller_klass = "#{env['devise.mapping'].controllers[:omniauth_callbacks].camelize}Controller"
|
||||
controller_klass.constantize.action(:failure).call(env)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue