Permalink
Browse files

FB uses "expires" instead of "expires_in"

  • Loading branch information...
1 parent 9bf41c9 commit e913eab34366477d6c83507e16cb2b9bc0535250 @nov committed Oct 16, 2012
Showing with 5 additions and 2 deletions.
  1. +4 −1 lib/rack/oauth2/access_token/legacy.rb
  2. +1 −1 spec/mock_response/tokens/legacy.txt
View
5 lib/rack/oauth2/access_token/legacy.rb
@@ -4,7 +4,10 @@ class AccessToken
class Legacy < AccessToken
def initialize(attributes = {})
super
- self.expires_in = self.expires_in.try(:to_i)
+ self.expires_in = (
+ self.expires_in ||
+ attributes[:expires]
+ ).try(:to_i)
end
def to_s # This is for fb_graph
View
2 spec/mock_response/tokens/legacy.txt
@@ -1 +1 @@
-access_token=access_token&expires_in=3600
+access_token=access_token&expires=3600

0 comments on commit e913eab

Please sign in to comment.