Skip to content

Commit

Permalink
Remove deprecated OmniAuth URL helpers.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmazza committed May 3, 2016
1 parent e79201a commit f64022a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 52 deletions.
1 change: 0 additions & 1 deletion lib/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,6 @@ def self.warden(&block)
# config.omniauth :github, APP_ID, APP_SECRET
#
def self.omniauth(provider, *args)
@@helpers << Devise::OmniAuth::UrlHelpers
config = Devise::OmniAuth::Config.new(provider, args)
@@omniauth_configs[config.strategy_name.to_sym] = config
end
Expand Down
51 changes: 0 additions & 51 deletions lib/devise/omniauth/url_helpers.rb
Original file line number Diff line number Diff line change
@@ -1,57 +1,6 @@
module Devise
module OmniAuth
module UrlHelpers
def self.define_helpers(mapping)
return unless mapping.omniauthable?

mapping = mapping.name

class_eval do
define_method("#{mapping}_omniauth_authorize_path") do |provider, *args|
ActiveSupport::Deprecation.warn(<<-DEPRECATION.strip_heredoc)
[Devise] #{mapping}_omniauth_authorize_path(#{provider.inspect}) is deprecated and it will be removed from Devise 4.2.
Please use #{mapping}_#{provider}_omniauth_authorize_path instead.
DEPRECATION
send("#{mapping}_#{provider}_omniauth_authorize_path", *args)
end

define_method("#{mapping}_omniauth_authorize_url") do |provider, *args|
ActiveSupport::Deprecation.warn(<<-DEPRECATION.strip_heredoc)
[Devise] #{mapping}_omniauth_authorize_url(#{provider.inspect}) is deprecated and it will be removed from Devise 4.2.
Please use #{mapping}_#{provider}_omniauth_authorize_url instead.
DEPRECATION
send("#{mapping}_#{provider}_omniauth_authorize_url", *args)
end

define_method("#{mapping}_omniauth_callback_path") do |provider, *args|
ActiveSupport::Deprecation.warn(<<-DEPRECATION.strip_heredoc)
[Devise] #{mapping}_omniauth_callback_path(#{provider.inspect}) is deprecated and it will be removed from Devise 4.2.
Please use #{mapping}_#{provider}_omniauth_callback_path instead.
DEPRECATION
send("#{mapping}_#{provider}_omniauth_callback_path", *args)
end

define_method("#{mapping}_omniauth_callback_url") do |provider, *args|
ActiveSupport::Deprecation.warn(<<-DEPRECATION.strip_heredoc)
[Devise] #{mapping}_omniauth_callback_url(#{provider.inspect}) is deprecated and it will be removed from Devise 4.2.
Please use #{mapping}_#{provider}_omniauth_callback_url instead.
DEPRECATION
send("#{mapping}_#{provider}_omniauth_callback_url", *args)
end
end

ActiveSupport.on_load(:action_controller) do
if respond_to?(:helper_method)
helper_method "#{mapping}_omniauth_authorize_path", "#{mapping}_omniauth_authorize_url"
helper_method "#{mapping}_omniauth_callback_path", "#{mapping}_omniauth_callback_url"
end
end
end

def omniauth_authorize_path(resource_or_scope, provider, *args)
scope = Devise::Mapping.find_scope!(resource_or_scope)
_devise_route_context.send("#{scope}_#{provider}_omniauth_authorize_path", *args)
Expand Down

0 comments on commit f64022a

Please sign in to comment.