Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Handle session expiry in the event there is already another #9

Open
wants to merge 1 commit into from

2 participants

@mkremer

this fixes the problem experienced in issue #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 3, 2012
  1. @mkremer

    Handle session expiry in the event there is already another

    mkremer authored
    omniauth-oauth session
This page is out of date. Refresh to see the latest.
View
2  lib/omniauth/strategies/oauth.rb
@@ -43,7 +43,7 @@ def request_phase
end
def callback_phase
- raise OmniAuth::NoSessionError.new("Session Expired") if session['oauth'].nil?
+ raise OmniAuth::NoSessionError.new("Session Expired") if session['oauth'].nil? || session['oauth'][name.to_s].nil?
request_token = ::OAuth::RequestToken.new(consumer, session['oauth'][name.to_s].delete('request_token'), session['oauth'][name.to_s].delete('request_secret'))
View
2  spec/omniauth/strategies/oauth_spec.rb
@@ -136,7 +136,7 @@ def session
before do
stub_request(:post, 'https://api.example.org/oauth/access_token').
to_return(:body => "oauth_token=yourtoken&oauth_token_secret=yoursecret")
- get '/auth/example.org/callback', {:oauth_verifier => 'dudeman'}, {'rack.session' => {}}
+ get '/auth/example.org/callback', {:oauth_verifier => 'dudeman'}, {'rack.session' => {'oauth' => {'anotherexample' => {'callback_confirmed' => true}}}}
end
it 'should call fail! with :session_expired' do
Something went wrong with that request. Please try again.