Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'sinatra/base'
- require 'omniauth'
- class Application < Sinatra::Base
- use OmniAuth::Builder do
- provider :github, 'github_id', 'github_secret'
- end
- get '/' do
- '<a href="/auth/github">Sign in via Github</a>'
- end
- get '/auth/:name/callback' do
- "Welcome, #{request.env['omniauth.auth']['user_info']['nickname']}!"
- end
- run! if $0 == __FILE__
- end
Add Comment
Please, Sign In to add comment