Permalink
Browse files

Fixed issue with assigning an expiration time of nil being set to 0.

git-svn-id: https://oauth-signet.googlecode.com/svn/trunk@33 7af18d84-67ec-4026-b916-6c96ec723f59
  • Loading branch information...
1 parent 0ef8f5c commit aeb18a7abe1e37194cea92f5e94f01378ec6b6de Bob Aman committed Aug 2, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/signet/oauth_2/client.rb
@@ -520,8 +520,12 @@ def expires_in
# @param [String] new_expires_in
# The access token lifetime.
def expires_in=(new_expires_in)
- @expires_in = new_expires_in.to_i
- @issued_at = Time.now
+ if new_expires_in != nil
+ @expires_in = new_expires_in.to_i
+ @issued_at = Time.now
+ else
+ @expires_in, @issued_at = nil, nil
+ end
end
##

0 comments on commit aeb18a7

Please sign in to comment.