Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rkh/730278 to your computer and use it in GitHub Desktop.
Save rkh/730278 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment