Skip to content

Commit cb3c102

Browse files
committed
Don't try to use AuthProviderSilent if there is no token cache file.
1 parent d8d181e commit cb3c102

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/sumo/wrapper/_auth_provider.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,12 @@ def get_auth_provider(
406406
if os.path.exists(get_token_path(resource_id, ".sharedkey")):
407407
return AuthProviderSumoToken(resource_id)
408408
# ELSE
409-
auth_silent = AuthProviderSilent(client_id, authority, resource_id)
410-
token = auth_silent.get_token()
411-
if token is not None:
412-
return auth_silent
409+
if os.path.exists(get_token_path(resource_id, ".token")):
410+
auth_silent = AuthProviderSilent(client_id, authority, resource_id)
411+
token = auth_silent.get_token()
412+
if token is not None:
413+
return auth_silent
414+
pass
413415
# ELSE
414416
if interactive:
415417
return AuthProviderInteractive(client_id, authority, resource_id)

0 commit comments

Comments
 (0)