Skip to content

Commit 4a8d02d

Browse files
committedJul 17, 2024·
fix(vertex): also refresh auth if there is no token
1 parent 4ff067f commit 4a8d02d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/anthropic/lib/vertex/_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def _ensure_access_token(self) -> str:
164164
if not self.project_id:
165165
self.project_id = project_id
166166

167-
if self.credentials.expired:
167+
if self.credentials.expired or not self.credentials.token:
168168
refresh_auth(self.credentials)
169169

170170
if not self.credentials.token:
@@ -330,7 +330,7 @@ async def _ensure_access_token(self) -> str:
330330
if not self.project_id:
331331
self.project_id = project_id
332332

333-
if self.credentials.expired:
333+
if self.credentials.expired or not self.credentials.token:
334334
await asyncify(refresh_auth)(self.credentials)
335335

336336
if not self.credentials.token:

0 commit comments

Comments
 (0)