4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/devise/omniauth/url_helpers.rb', line 4
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.1.
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.1.
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.1.
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.1.
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
|