1
0
Fork 0
mirror of https://github.com/nov/fb_graph2 synced 2023-03-27 23:22:15 -04:00
fb_graph2/lib/patch/rack/oauth2/util.rb
nov 8b51961c49 use prepend, since fb_graph2 doesn't need ruby 1.9.x support
close #102

NOTE: we still have alias_method_chain in rack-oauth2 etc.
2016-01-20 13:32:17 +09:00

17 lines
No EOL
455 B
Ruby

# NOTE: Authorization code given via FB JS SDK needs blank string as redirect_uri
module Rack::OAuth2::Util
class << self
module ComcactHashWithBrankRedirect
def compact_hash(hash)
original_redirect_uri = hash[:redirect_uri]
result = super
if original_redirect_uri
result[:redirect_uri] ||= original_redirect_uri
end
result
end
end
prepend ComcactHashWithBrankRedirect
end
end