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
This commit is contained in:
Bob Aman 2011-05-20 23:39:42 +00:00
parent f962346722
commit ccade868a9
1 changed files with 1 additions and 0 deletions

View File

@ -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')