2015-12-12 11:05:31 -05:00
|
|
|
# NOTE: Authorization code given via FB JS SDK needs blank string as redirect_uri
|
2016-01-19 23:31:27 -05:00
|
|
|
|
2015-12-12 11:05:31 -05:00
|
|
|
module Rack::OAuth2::Util
|
|
|
|
class << self
|
2016-01-19 23:31:27 -05:00
|
|
|
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
|
2015-12-12 11:05:31 -05:00
|
|
|
end
|
|
|
|
end
|
2016-01-19 23:31:27 -05:00
|
|
|
prepend ComcactHashWithBrankRedirect
|
2015-12-12 11:05:31 -05:00
|
|
|
end
|
|
|
|
end
|