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:
1 parent
f962346722
commit
ccade868a9
1 file changed
+1
@@ -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')
|
||||
|
||||
Reference in new issue
Block a user