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

Commit

Permalink
change valid_token from class method to instance method
Browse files Browse the repository at this point in the history
  • Loading branch information
mfo committed Jan 22, 2013
1 parent 0fd01ba commit 3dbdd21
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/ruby_picasa.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,12 @@ def authorize_request(request)

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

http = Net::HTTP.new("www.google.com", 443)
http.use_ssl = true
response = http.get('/accounts/AuthSubTokenInfo', { "Authorization" => %{AuthSub token="#{ token }"} })
response = http.get('/accounts/AuthSubTokenInfo', auth_header)

response.status.to_s == "200"
end
Expand Down

0 comments on commit 3dbdd21

Please sign in to comment.