Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Commit

Permalink
move method valid_token
Browse files Browse the repository at this point in the history
  • Loading branch information
mfo committed Jan 22, 2013
1 parent 3dbdd21 commit a435ed9
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/ruby_picasa.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,6 @@ def authorize_request(request)
p
end

# Takes a SubAuthToken and verify if it's still valid
# see: https://developers.google.com/accounts/docs/AuthSub?hl=fr#AuthSubTokenInfo
def valid_token?(token)
@token = token

http = Net::HTTP.new("www.google.com", 443)
http.use_ssl = true
response = http.get('/accounts/AuthSubTokenInfo', auth_header)

response.status.to_s == "200"
end

# The url to make requests to without the protocol or path.
def host
@host ||= 'picasaweb.google.com'
Expand Down Expand Up @@ -210,6 +198,18 @@ def initialize(token)
@request_cache = {}
end

# Takes a SubAuthToken and verify if it's still valid
# see: https://developers.google.com/accounts/docs/AuthSub?hl=fr#AuthSubTokenInfo
def valid_token?(token)
@token = token

http = Net::HTTP.new("www.google.com", 443)
http.use_ssl = true
response = http.get('/accounts/AuthSubTokenInfo', auth_header)

response.status.to_s == "200"
end

# Attempt to upgrade the current AuthSub token to a permanent one. This only
# works if the Picasa session is initialized with a single use token.
def authorize_token!
Expand Down

0 comments on commit a435ed9

Please sign in to comment.