mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Properly ignore path prefix on omniauthable
This commit is contained in:
parent
d58a72ee32
commit
1bf7da148a
2 changed files with 7 additions and 1 deletions
|
@ -1,3 +1,6 @@
|
|||
* bug fix
|
||||
* Properly ignore path prefix on omniauthable
|
||||
|
||||
== 1.2.rc2
|
||||
|
||||
* enhancements
|
||||
|
|
|
@ -263,6 +263,7 @@ module ActionDispatch::Routing
|
|||
end
|
||||
|
||||
def devise_omniauth_callback(mapping, controllers) #:nodoc:
|
||||
path, @scope[:path] = @scope[:path], nil
|
||||
path_prefix = "/#{mapping.path}/auth"
|
||||
|
||||
if ::OmniAuth.config.path_prefix && ::OmniAuth.config.path_prefix != path_prefix
|
||||
|
@ -271,8 +272,10 @@ module ActionDispatch::Routing
|
|||
::OmniAuth.config.path_prefix = path_prefix
|
||||
end
|
||||
|
||||
match "/auth/:action/callback", :action => Regexp.union(mapping.to.omniauth_providers.map(&:to_s)),
|
||||
match "#{path_prefix}/:action/callback", :action => Regexp.union(mapping.to.omniauth_providers.map(&:to_s)),
|
||||
:to => controllers[:omniauth_callbacks], :as => :omniauth_callback
|
||||
ensure
|
||||
@scope[:path] = path
|
||||
end
|
||||
|
||||
def with_devise_exclusive_scope(new_path, new_as) #:nodoc:
|
||||
|
|
Loading…
Add table
Reference in a new issue