mirror of
https://github.com/nov/fb_graph2
synced 2023-03-27 23:22:15 -04:00
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.
This commit is contained in:
parent
820047e3b8
commit
8b51961c49
1 changed files with 10 additions and 7 deletions
|
@ -1,14 +1,17 @@
|
||||||
# NOTE: Authorization code given via FB JS SDK needs blank string as redirect_uri
|
# NOTE: Authorization code given via FB JS SDK needs blank string as redirect_uri
|
||||||
|
|
||||||
module Rack::OAuth2::Util
|
module Rack::OAuth2::Util
|
||||||
class << self
|
class << self
|
||||||
def compact_hash_with_blank_redirect_uri(hash)
|
module ComcactHashWithBrankRedirect
|
||||||
|
def compact_hash(hash)
|
||||||
original_redirect_uri = hash[:redirect_uri]
|
original_redirect_uri = hash[:redirect_uri]
|
||||||
result = compact_hash_without_blank_redirect_uri hash
|
result = super
|
||||||
if original_redirect_uri
|
if original_redirect_uri
|
||||||
result[:redirect_uri] ||= original_redirect_uri
|
result[:redirect_uri] ||= original_redirect_uri
|
||||||
end
|
end
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
alias_method_chain :compact_hash, :blank_redirect_uri
|
end
|
||||||
|
prepend ComcactHashWithBrankRedirect
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in a new issue