0

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 welcome!!!

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" 
}
Udo Held
  • 12,314
  • 11
  • 67
  • 93
altuure
  • 193
  • 2
  • 9
  • sorry for delay but I commited the patch to the github you can find the details over here https://github.com/intridea/omniauth/issues/485 – altuure Jan 16 '12 at 12:30

2 Answers2

0

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.

d11wtq
  • 34,788
  • 19
  • 120
  • 195
0

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

altuure
  • 193
  • 2
  • 9