Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,7 +22,8 @@ SALESFORCE_OAUTH_URL = "https://login.salesforce.com/services/oauth2/authorize"
|
|
| 22 |
SALESFORCE_TOKEN_URL = "https://login.salesforce.com/services/oauth2/token"
|
| 23 |
CLIENT_ID = os.getenv('SALESFORCE_CLIENT_ID', 'your_client_id') # Use environment variables
|
| 24 |
CLIENT_SECRET = os.getenv('SALESFORCE_CLIENT_SECRET', 'your_client_secret') # Use environment variables
|
| 25 |
-
REDIRECT_URI = os.getenv('SALESFORCE_REDIRECT_URI', 'https://huggingface.co/spaces/nagasurendra/BiryaniHubflask21
|
|
|
|
| 26 |
|
| 27 |
# Salesforce connection setup
|
| 28 |
def get_salesforce_connection():
|
|
@@ -62,7 +63,7 @@ def oauth_callback():
|
|
| 62 |
if token_response.status_code == 200:
|
| 63 |
token_info = token_response.json()
|
| 64 |
access_token = token_info['sSSjyhInIsUohKpG8sHzty2q'] # Correct key to fetch the access token
|
| 65 |
-
instance_url = token_info['https://
|
| 66 |
|
| 67 |
# Store access token in session for future API requests
|
| 68 |
session['access_token'] = access_token
|
|
|
|
| 22 |
SALESFORCE_TOKEN_URL = "https://login.salesforce.com/services/oauth2/token"
|
| 23 |
CLIENT_ID = os.getenv('SALESFORCE_CLIENT_ID', 'your_client_id') # Use environment variables
|
| 24 |
CLIENT_SECRET = os.getenv('SALESFORCE_CLIENT_SECRET', 'your_client_secret') # Use environment variables
|
| 25 |
+
REDIRECT_URI = os.getenv('SALESFORCE_REDIRECT_URI', 'https://huggingface.co/spaces/nagasurendra/BiryaniHubflask21/oauth/callback
|
| 26 |
+
') # Your Hugging Face redirect URI
|
| 27 |
|
| 28 |
# Salesforce connection setup
|
| 29 |
def get_salesforce_connection():
|
|
|
|
| 63 |
if token_response.status_code == 200:
|
| 64 |
token_info = token_response.json()
|
| 65 |
access_token = token_info['sSSjyhInIsUohKpG8sHzty2q'] # Correct key to fetch the access token
|
| 66 |
+
instance_url = token_info['https://na1.salesforce.com'] # Correct key to fetch the instance URL
|
| 67 |
|
| 68 |
# Store access token in session for future API requests
|
| 69 |
session['access_token'] = access_token
|