Merge pull request #1903 from zamith/master

Routes for engines
This commit is contained in:
José Valim
2012-06-08 10:05:56 -07:00
2 changed files with 6 additions and 1 deletions

View File

@@ -199,6 +199,11 @@ module Devise
# to provide custom routes.
mattr_accessor :router_name
@@router_name = nil
# Set the omniauth path prefix so it can be overriden when
# Devise is used in a mountable engine
mattr_accessor :omniauth_path_prefix
@@omniauth_path_prefix = nil
def self.encryptor=(value)
warn "\n[DEVISE] To select a encryption which isn't bcrypt, you should use devise-encryptable gem.\n"

View File

@@ -382,7 +382,7 @@ module ActionDispatch::Routing
def devise_omniauth_callback(mapping, controllers) #:nodoc:
path, @scope[:path] = @scope[:path], nil
path_prefix = "/#{mapping.path}/auth".squeeze("/")
path_prefix = Devise.omniauth_path_prefix || "/#{mapping.path}/auth".squeeze("/")
set_omniauth_path_prefix!(path_prefix)
match "#{path_prefix}/:action/callback", :constraints => { :action => Regexp.union(mapping.to.omniauth_providers.map(&:to_s)) },