Properly ignore path prefix on omniauthable
This commit is contained in:
parent
d58a72ee32
commit
1bf7da148a
|
@ -1,3 +1,6 @@
|
||||||
|
* bug fix
|
||||||
|
* Properly ignore path prefix on omniauthable
|
||||||
|
|
||||||
== 1.2.rc2
|
== 1.2.rc2
|
||||||
|
|
||||||
* enhancements
|
* enhancements
|
||||||
|
|
|
@ -263,6 +263,7 @@ module ActionDispatch::Routing
|
||||||
end
|
end
|
||||||
|
|
||||||
def devise_omniauth_callback(mapping, controllers) #:nodoc:
|
def devise_omniauth_callback(mapping, controllers) #:nodoc:
|
||||||
|
path, @scope[:path] = @scope[:path], nil
|
||||||
path_prefix = "/#{mapping.path}/auth"
|
path_prefix = "/#{mapping.path}/auth"
|
||||||
|
|
||||||
if ::OmniAuth.config.path_prefix && ::OmniAuth.config.path_prefix != path_prefix
|
if ::OmniAuth.config.path_prefix && ::OmniAuth.config.path_prefix != path_prefix
|
||||||
|
@ -271,8 +272,10 @@ module ActionDispatch::Routing
|
||||||
::OmniAuth.config.path_prefix = path_prefix
|
::OmniAuth.config.path_prefix = path_prefix
|
||||||
end
|
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
|
:to => controllers[:omniauth_callbacks], :as => :omniauth_callback
|
||||||
|
ensure
|
||||||
|
@scope[:path] = path
|
||||||
end
|
end
|
||||||
|
|
||||||
def with_devise_exclusive_scope(new_path, new_as) #:nodoc:
|
def with_devise_exclusive_scope(new_path, new_as) #:nodoc:
|
||||||
|
|
Loading…
Reference in New Issue