From ccade868a962ac0f687777c0c5b0f3680b6384ed Mon Sep 17 00:00:00 2001 From: Bob Aman Date: Fri, 20 May 2011 23:39:42 +0000 Subject: [PATCH] Updated to handle expiration of access tokens. git-svn-id: https://google-api-ruby-client.googlecode.com/svn/trunk@160 c1d61fac-ed7f-fcc1-18f7-ff78120a04ef --- examples/buzz.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/buzz.rb b/examples/buzz.rb index cc172c1ae..ad94e9ba0 100644 --- a/examples/buzz.rb +++ b/examples/buzz.rb @@ -44,6 +44,7 @@ before do token_pair = TokenPair.get(session[:token_id]) @client.authorization.update_token!(token_pair.to_hash) end + @client.authorization.fetch_access_token! if @client.authorization.expired? @buzz = @client.discovered_api('buzz') unless @client.authorization.access_token || request.path_info =~ /^\/oauth2/ redirect to('/oauth2authorize')