Skip to content

Commit

Permalink
Revert "Same sequence of json store", because read_ticket_from_store …
Browse files Browse the repository at this point in the history
…must return ticket.

This reverts commit db5aa21.
  • Loading branch information
Eric-Guo committed Jan 23, 2016
1 parent 1e05257 commit 53c82e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/wechat/ticket/jsapi_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ def signature(url)

def read_ticket_from_store
td = read_ticket
@access_ticket = td.fetch('ticket')
@ticket_life_in_seconds = td.fetch('ticket_expires_in').to_i
@got_ticket_at = td.fetch('got_ticket_at').to_i
@access_ticket = td.fetch('ticket') # return access_ticket same time
rescue JSON::ParserError, Errno::ENOENT, KeyError, TypeError
refresh
end
Expand Down
2 changes: 1 addition & 1 deletion lib/wechat/token/access_token_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def token

def read_token_from_store
td = read_token
@access_token = td.fetch('access_token')
@token_life_in_seconds = td.fetch('token_expires_in').to_i
@got_token_at = td.fetch('got_token_at').to_i
@access_token = td.fetch('access_token') # return access_token same time
rescue JSON::ParserError, Errno::ENOENT, KeyError, TypeError
refresh
end
Expand Down

0 comments on commit 53c82e6

Please sign in to comment.