aerc sendmail wip
This commit is contained in:
@@ -81,8 +81,13 @@ def get_access_token(scopes):
|
||||
|
||||
token_response = app.acquire_token_by_device_flow(flow)
|
||||
|
||||
if token_response is None:
|
||||
raise Exception("Token response is None - authentication failed")
|
||||
|
||||
if "access_token" not in token_response:
|
||||
raise Exception("Failed to acquire token")
|
||||
error_description = token_response.get("error_description", "Unknown error")
|
||||
error_code = token_response.get("error", "unknown_error")
|
||||
raise Exception(f"Failed to acquire token - {error_code}: {error_description}")
|
||||
|
||||
# Save token cache
|
||||
with open(cache_file, "w") as f:
|
||||
|
||||
Reference in New Issue
Block a user