Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Append signed request on redirect

  • Loading branch information...
commit 5ef74c948e9997e4c22e08f3911e2002b7c58694 1 parent ee22fd7
@dekart authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 lib/facebooker2/rails/controller.rb
View
16 lib/facebooker2/rails/controller.rb
@@ -164,6 +164,22 @@ def fetch_client_and_user_from_signed_request
end
end
+ # Appends facebook signed_request to params on redirect
+ def redirect_to(options = {}, response_status = {})
+ unless facebook_signed_request.blank?
+ case options
+ when String
+ # append signed_request param to query string
+ uri = URI.parse(options)
+ uri.query = (uri.query ? "#{uri.query}&" : "") + "signed_request=#{facebook_signed_request}"
+ options = uri.to_s
+ when Hash
+ options[:signed_request] ||= facebook_signed_request
+ end
+ end
+
+ super(options, response_status)
+ end
def redirect_from_iframe(url_options)
redirect_url = url_options.is_a?(String) ? url_options : url_for(url_options)
Please sign in to comment.
Something went wrong with that request. Please try again.