mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-10 08:08:00 -05:00
Merge pull request #2227 from AlexanderZaytsev/master
Use mapping.fullpath in omniauth callbacks
This commit is contained in:
@@ -386,8 +386,14 @@ module ActionDispatch::Routing
|
||||
end
|
||||
|
||||
def devise_omniauth_callback(mapping, controllers) #:nodoc:
|
||||
if mapping.fullpath =~ /:[a-zA-Z_]/
|
||||
raise "[DEVISE] Nesting omniauth callbacks under scopes with dynamic segments " \
|
||||
"is not supported. Please, use Devise.omniauth_path_prefix instead."
|
||||
end
|
||||
|
||||
path, @scope[:path] = @scope[:path], nil
|
||||
path_prefix = Devise.omniauth_path_prefix || "/#{mapping.path}/auth".squeeze("/")
|
||||
path_prefix = Devise.omniauth_path_prefix || "/#{mapping.fullpath}/auth".squeeze("/")
|
||||
|
||||
set_omniauth_path_prefix!(path_prefix)
|
||||
|
||||
providers = Regexp.union(mapping.to.omniauth_providers.map(&:to_s))
|
||||
|
||||
Reference in New Issue
Block a user