开发者

omniauth gowalla strategy error: comparison of String with Bignum failed

as far as I can get gowalla auth code response contains both expires_at and expires_in but expires_at is not valid date string so it throws error while comparing dates

any idea to hack omniauth or gowalla strategy would be very welco开发者_如何学运维me!!!

rails 3.0.9 ruby 1.9.2

comparison of String with Bignum failed
oauth2 (0.5.0) lib/oauth2/access_token.rb:72:in `<'
oauth2 (0.5.0) lib/oauth2/access_token.rb:72:in `expired?'
oa-oauth (0.3.0) lib/omniauth/strategies/oauth2.rb:67:in `callback_phase'


{
"scope":"read",
"expires_at":"Sun, 09 Oct 2011 12:47:37 -0000",
"username":"altuure",
"expires_in":1172767,
"refresh_token":"XX",
"access_token":"XX" 
}


Why don't you just use whatever you can. expires_in appears to be an interval, so you can do:

expires_at = Time.now + json["expires_in"].to_i

That said, the date string for expires_at definitely parses in 1.9.2-p290 (using DateTime.parse(str)). There's always DateTime.strptime if you need to parse a date/time string according to a given format.


sorry for delay but I commited the patch to the github you can find the details over here http://github.com/intridea/omniauth/issues/485 –

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜