Permalink
Browse files

Don't try to set cookies

  • Loading branch information...
1 parent de1c0e8 commit 0edb6634c40de2337f82c28f0bf4ea96560a699d @dekart committed Jun 10, 2011
Showing with 5 additions and 15 deletions.
  1. +5 −15 lib/facebooker2/rails/controller.rb
@@ -36,23 +36,13 @@ def current_facebook_client
# https://github.com/facebook/php-sdk/blob/master/src/facebook.php#L333
#
def fetch_client_and_user
- return if @_fb_user_fetched
+ unless @_fb_user_fetched
+ # Try to authenticate from the signed request first
+ fetch_client_and_user_from_signed_request
+ fetch_client_and_user_from_cookie if @_current_facebook_client.nil? and !signed_request_from_logged_out_user?
- # Try to authenticate from the signed request first
- sig = fetch_client_and_user_from_signed_request
- sig = fetch_client_and_user_from_cookie if @_current_facebook_client.nil? and !signed_request_from_logged_out_user?
-
- #write the authentication params to a new cookie
- if !@_current_facebook_client.nil?
- #we may have generated the signature based on the params in @facebook_params, and the expiration here is different
-
- set_fb_cookie(@_current_facebook_client.access_token, @_current_facebook_client.expiration, @_current_facebook_user.id, sig)
- else
- # if we do not have a client, delete the cookie
- set_fb_cookie(nil,nil,nil,nil)
+ @_fb_user_fetched = true
end
-
- @_fb_user_fetched = true
end

0 comments on commit 0edb663

Please sign in to comment.