Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: dd92aedffb
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (28 sloc) 0.628 kb
require 'uuid'
require 'sinatra/base'
module OauthProxy
extend self
@uuid = UUID.new
attr_reader :callbacks
@callbacks = {}
def remember(v)
id = @uuid.generate
@callbacks[id] = v
return id
end
def forget(k)
@callbacks.delete(k)
end
class App < Sinatra::Base
get '/callback/:slug' do
unless OauthProxy.callbacks.include?(params['slug'])
halt 404, "Slug not found"
end
OauthProxy.callbacks[params['slug']].q.enq params['code']
"Ideally, your oauth app should now be configured. Enjoy!"
end
get '/' do
"Rawr at index!"
end
end
end
Jump to Line
Something went wrong with that request. Please try again.