Guest User

Untitled

a guest
Jul 16th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. require 'sinatra/base'
  2. require 'omniauth'
  3.  
  4. class Application < Sinatra::Base
  5.  
  6. use OmniAuth::Builder do
  7. provider :github, 'github_id', 'github_secret'
  8. end
  9.  
  10. get '/' do
  11. '<a href="/auth/github">Sign in via Github</a>'
  12. end
  13.  
  14. get '/auth/:name/callback' do
  15. "Welcome, #{request.env['omniauth.auth']['user_info']['nickname']}!"
  16. end
  17.  
  18. run! if $0 == __FILE__
  19. end
Add Comment
Please, Sign In to add comment