Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use options[:store] where it's supposed to be used, makes things run.

  • Loading branch information...
commit 70601782e9e8abd1cba0932f2bd93c5df68fd30f 1 parent 94dbf9e
@mbleigh mbleigh authored
Showing with 8 additions and 6 deletions.
  1. +7 −4 examples/sinatra.rb
  2. +1 −2  lib/omniauth/strategies/open_id.rb
View
11 examples/sinatra.rb
@@ -4,11 +4,12 @@
Bundler.setup :default, :development, :example
require 'sinatra'
require 'omniauth-openid'
+require 'openid/store/filesystem'
use Rack::Session::Cookie
use OmniAuth::Builder do
- provider :open_id
+ provider :open_id, store: OpenID::Store::Filesystem.new('/tmp')
end
get '/' do
@@ -19,7 +20,9 @@
HTML
end
-get '/auth/:provider/callback' do
- content_type 'text/plain'
- request.env['omniauth.auth'].info.to_hash.inspect
+[:get, :post].each do |method|
+ send method, '/auth/:provider/callback' do
+ content_type 'text/plain'
+ request.env['omniauth.auth'].info.to_hash.inspect
+ end
end
View
3  lib/omniauth/strategies/open_id.rb
@@ -83,7 +83,7 @@ def callback_phase
def openid_response
unless @openid_response
- openid = Rack::OpenID.new(lambda{|env| [200,{},[]]}, @store)
+ openid = Rack::OpenID.new(lambda{|env| [200,{},[]]}, options[:store])
openid.call(env)
@openid_response = env.delete('rack.openid.response')
end
@@ -91,7 +91,6 @@ def openid_response
end
def sreg_user_info
- raise openid_response.inspect
sreg = ::OpenID::SReg::Response.from_success_response(openid_response)
return {} unless sreg
{
Please sign in to comment.
Something went wrong with that request. Please try again.