xiddiqui commited on
Commit
43397c6
·
1 Parent(s): 3d27eec

updated app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -8,12 +8,20 @@ from googleapiclient.discovery import build
8
  import base64
9
  from datetime import datetime, timedelta
10
 
 
11
  # Gmail API scope
12
  SCOPES = ['https://www.googleapis.com/auth/gmail.readonly']
13
 
14
- # Load OAuth credentials
15
- with open('client_secret.json') as f:
16
- CLIENT_CONFIG = json.load(f)
 
 
 
 
 
 
 
17
 
18
  # Keywords for filtering emails
19
  KEYWORDS = {
 
8
  import base64
9
  from datetime import datetime, timedelta
10
 
11
+ # Gmail API scope
12
  # Gmail API scope
13
  SCOPES = ['https://www.googleapis.com/auth/gmail.readonly']
14
 
15
+ # Instead of reading from file, get credentials from environment variables
16
+ CLIENT_CONFIG = {
17
+ "installed": {
18
+ "client_id": os.environ.get('GOOGLE_CLIENT_ID'),
19
+ "client_secret": os.environ.get('GOOGLE_CLIENT_SECRET'),
20
+ "redirect_uris": ["urn:ietf:wg:oauth:2.0:oob"],
21
+ "auth_uri": "https://accounts.google.com/o/oauth2/auth",
22
+ "token_uri": "https://oauth2.googleapis.com/token",
23
+ }
24
+ }
25
 
26
  # Keywords for filtering emails
27
  KEYWORDS = {