Skip to content

Commit 8c16f72

Browse files
committed
template
1 parent 8189a56 commit 8c16f72

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

custom_templates/configuration.mustache

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)