mirror of
https://github.com/simi/omniauth-facebook.git
synced 2022-11-09 12:32:45 -05:00
27 lines
497 B
Ruby
27 lines
497 B
Ruby
require 'bundler/setup'
|
|
require 'sinatra/base'
|
|
require 'omniauth-facebook'
|
|
|
|
class App < Sinatra::Base
|
|
get '/' do
|
|
redirect '/auth/facebook'
|
|
end
|
|
|
|
get '/auth/:provider/callback' do
|
|
content_type 'application/json'
|
|
MultiJson.encode(request.env)
|
|
end
|
|
|
|
get '/auth/failure' do
|
|
content_type 'application/json'
|
|
MultiJson.encode(request.env)
|
|
end
|
|
end
|
|
|
|
use Rack::Session::Cookie
|
|
|
|
use OmniAuth::Builder do
|
|
provider :facebook, ENV['APP_ID'], ENV['APP_SECRET']
|
|
end
|
|
|
|
run App.new
|