Skip to content
Browse files

Expires set correctly as an offset instead of an epoch timestamp

  • Loading branch information...
1 parent 164eba6 commit 38f15ffdd33cede4b7b24bf15729174aad86ef4d U-James-PC\James committed May 18, 2011
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/mogli/client.rb
View
9 lib/mogli/client.rb
@@ -55,7 +55,14 @@ def self.create_from_code_and_authenticator(code,authenticator)
parts.each do |p| (k,v) = p.split("=")
hash[k]=CGI.unescape(v)
end
- new(hash["access_token"],hash["expires"].to_s.to_i)
+
+ if hash["expires"]
+ expires = Time.now.to_i + hash["expires"].to_i
+ else
+ expires = nil
+ end
+
+ new(hash["access_token"],expires)
end
def self.raise_client_exception(post_data)

0 comments on commit 38f15ff

Please sign in to comment.
Something went wrong with that request. Please try again.