File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -194,8 +194,9 @@ def initialize
194194 @logger = defined? ( Rails ) ? Rails . logger : Logger . new ( STDOUT )
195195 @access_token_expires_at = nil
196196 @access_token_getter = Proc . new {
197- access_token_valid = @access_token && @access_token_expires_at > Time . now + 60
197+ access_token_valid = @access_token && ( @access_token_expires_at . nil? || @access_token_expires_at > Time . now + 60 )
198198 next @access_token if access_token_valid
199+ next unless @client_id && @client_secret
199200
200201 puts "Refreshing access token..." if @debugging
201202 # obtain new access token using client credentials
@@ -272,7 +273,6 @@ def api_key_with_prefix(param_name, param_alias = nil)
272273 # Gets access_token using access_token_getter or uses the static access_token
273274 def access_token_with_refresh
274275 return access_token if access_token_getter . nil?
275- return unless @client_id && @client_secret
276276 access_token_getter . call
277277 end
278278
You can’t perform that action at this time.
0 commit comments