Skip to content

Commit

Permalink
fix(translate-v2): Ensure access token is fetched with recent googlea…
Browse files Browse the repository at this point in the history
…uth versions in the non-api-key case (#28096)
  • Loading branch information
dazuma authored Dec 11, 2024
1 parent 5494628 commit 398f03d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def sign_http_request! request
client = credentials.client
return if client.nil?

client.fetch_access_token! if client.expires_within? 30
client.fetch_access_token! if client.access_token.nil? || client.expires_within?(30)
client.generate_authenticated_request request: request
request
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ def expires_within? _
false
end

def access_token
:token
end

def generate_authenticated_request request:
end
end
Expand Down

0 comments on commit 398f03d

Please sign in to comment.