Permalink
Browse files

Clear session keys when done

  • Loading branch information...
1 parent 0e1e601 commit 276174d6f7ee13e5ee15c4b397f45e106731210a Jesse Stuart committed Oct 3, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/omniauth/strategies/tent.rb
@@ -44,6 +44,7 @@ def callback_phase
verify_state!
create_app_authorization!
build_auth_hash!
+ delete_state!
call_app!
rescue AppAuthorizationCreateFailure => e
fail!(:app_auth_create_failure, e)
@@ -171,6 +172,12 @@ def build_auth_hash!
)
end
+ def delete_state!
+ %w( entity app server_url profile state ).each do |key|
+ session.delete("omniauth.#{key}")
+ end
+ end
+
def extract_basic_info(profile)
basic_info = Hashie::Mash.new(profile.inject({}) { |memo, (k,v)|
memo = v if k =~ %r{^https://tent.io/types/info/basic}

0 comments on commit 276174d

Please sign in to comment.