require "omniauth/strategies/oauth2"

module OmniAuth
  module Strategies
    class CreateSend < OmniAuth::Strategies::OAuth2
      option :name, "createsend"
      option :client_options, {
        :site => "https://api.createsend.com",
        :authorize_url => "/oauth",
        :token_url => "/oauth/token"
      }
    end
  end
end

OmniAuth.config.add_camelization "createsend", "CreateSend"

require "omniauth/strategies/oauth2"

module OmniAuth
  module Strategies
    class CreateSend < OmniAuth::Strategies::OAuth2
      option :name, "createsend"
      option :client_options, {
        :site => "https://api.createsend.com",
        :authorize_url => "/oauth",
        :token_url => "/oauth/token"
      }

      def callback_url
        full_host + script_name + callback_path
      end
    end
  end
end

OmniAuth.config.add_camelization "createsend", "CreateSend"

Fix compatibility with omniauth-oauth2 v1.4+
Fix compatibility with omniauth-oauth2 v1.4+

References:
* https://github.com/intridea/omniauth-oauth2/pull/70
* https://github.com/intridea/omniauth-oauth2/commit/26152673224aca5c3e918bcc83075dbb0659717f
* https://github.com/intridea/omniauth-oauth2/pull/82
* https://github.com/jdennes/omniauth-createsend/issues/3
* https://github.com/WebTheoryLLC/omniauth-twitch/pull/4
