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:
parent
f962346722
commit
ccade868a9
|
@ -44,6 +44,7 @@ before do
|
||||||
token_pair = TokenPair.get(session[:token_id])
|
token_pair = TokenPair.get(session[:token_id])
|
||||||
@client.authorization.update_token!(token_pair.to_hash)
|
@client.authorization.update_token!(token_pair.to_hash)
|
||||||
end
|
end
|
||||||
|
@client.authorization.fetch_access_token! if @client.authorization.expired?
|
||||||
@buzz = @client.discovered_api('buzz')
|
@buzz = @client.discovered_api('buzz')
|
||||||
unless @client.authorization.access_token || request.path_info =~ /^\/oauth2/
|
unless @client.authorization.access_token || request.path_info =~ /^\/oauth2/
|
||||||
redirect to('/oauth2authorize')
|
redirect to('/oauth2authorize')
|
||||||
|
|
Loading…
Reference in New Issue