Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions examples/integrations/gmail_2fa_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,10 @@ def validate_credentials_format(self) -> tuple[bool, str]:
with open(self.credentials_file) as f:
creds = json.load(f)

required_fields = ['web']
web = creds['web']
if not web:
return False, "Invalid credentials format - missing 'web' section"

return True, 'Credentials file is valid'
# Accept if either 'web' or 'installed' section exists and is not empty
if creds.get('web') or creds.get('installed'):
return True, 'Credentials file is valid'
return False, "Invalid credentials format - neither 'web' nor 'installed' sections found"

except json.JSONDecodeError:
return False, 'Credentials file is not valid JSON'
Expand Down
Loading