File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -176,8 +176,9 @@ module {{moduleName}}
176176 { {#isOAuth} }
177177 @access_token_expires_at = nil
178178 @access_token_getter = Proc.new {
179- access_token_valid = @access_token && @access_token_expires_at > Time.now + 60
179+ access_token_valid = @access_token && ( @access_token_expires_at.nil? || @access_token_expires_at > Time.now + 60)
180180 next @access_token if access_token_valid
181+ next unless @client_id && @client_secret
181182
182183 puts " Refreshing access token..." if @debugging
183184 # obtain new access token using client credentials
@@ -256,11 +257,6 @@ module {{moduleName}}
256257 # Gets access_token using access_token_getter or uses the static access_token
257258 def access_token_with_refresh
258259 return access_token if access_token_getter.nil?
259- { {#authMethods} }
260- { {#isOAuth} }
261- return unless @client_id && @client_secret
262- { {/isOAuth} }
263- { {/authMethods} }
264260 access_token_getter.call
265261 end
266262
You can’t perform that action at this time.
0 commit comments