example/config.ru in omniauth-createsend-0.0.1 vs example/config.ru in omniauth-createsend-0.0.2
- old
+ new
@@ -5,13 +5,16 @@
class App < Sinatra::Base
get '/' do
redirect '/auth/createsend'
end
- get '/auth/:provider/callback' do
- content_type 'application/json'
- MultiJson.encode(request.env)
+ get '/auth/createsend/callback' do
+ response = "Your user is successfully authenticated. Here are you details you need:<br/><br/>"
+ response << "token: #{request.env['omniauth.auth']['credentials']['token']}<br/>"
+ response << "refresh token: #{request.env['omniauth.auth']['credentials']['refresh_token']}<br/>"
+ response << "expires at: #{request.env['omniauth.auth']['credentials']['expires_at']}<br/>"
+ response
end
get '/auth/failure' do
content_type 'application/json'
MultiJson.encode(request.env)
@@ -20,9 +23,9 @@
use Rack::Session::Cookie
use OmniAuth::Builder do
provider :createsend, ENV['CREATESEND_CLIENT_ID'], ENV['CREATESEND_CLIENT_SECRET'],
- :scope => 'ViewReports,ManageLists,CreateCampaigns,ImportSubscribers,SendCampaigns,ViewSubscribersInReports,ManageTemplates'
+ :scope => 'ViewReports,CreateCampaigns,SendCampaigns'
end
run App.new