Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -45,7 +45,7 @@ def process_and_store_bubble_token(url_user_token_str, current_token_state):
|
|
45 |
print(bubble_api_status_msg)
|
46 |
new_token_state["client_id"] = "ENV VAR MISSING" # Indicate error in state
|
47 |
# Return values: bubble_api_status, overall_token_status, new_token_state
|
48 |
-
return
|
49 |
|
50 |
# Store client_id from env in the state, regardless of token outcome (if env var exists)
|
51 |
new_token_state["client_id"] = linkedin_client_id_from_env
|
@@ -53,7 +53,7 @@ def process_and_store_bubble_token(url_user_token_str, current_token_state):
|
|
53 |
if not url_user_token_str or "not found" in url_user_token_str or "Could not access" in url_user_token_str:
|
54 |
bubble_api_status_msg = f"ℹ️ No valid user token from URL to query Bubble. ({url_user_token_str})"
|
55 |
# Client ID is known (if env var was found), but no token to fetch
|
56 |
-
return
|
57 |
|
58 |
print(f"Attempting to fetch token from Bubble with user token: {url_user_token_str}") # Changed "state" to "user token" for clarity
|
59 |
parsed_token_dict = fetch_linkedin_token_from_bubble(url_user_token_str)
|
@@ -68,7 +68,7 @@ def process_and_store_bubble_token(url_user_token_str, current_token_state):
|
|
68 |
# Token fetch failed, token remains None. Client_id is already set if env var was found.
|
69 |
|
70 |
# Return values: bubble_api_status, overall_token_status, new_token_state
|
71 |
-
return
|
72 |
|
73 |
# --- Guarded fetch functions (now use token_state, checking only for token presence) ---
|
74 |
def guarded_fetch_dashboard(current_token_state):
|
|
|
45 |
print(bubble_api_status_msg)
|
46 |
new_token_state["client_id"] = "ENV VAR MISSING" # Indicate error in state
|
47 |
# Return values: bubble_api_status, overall_token_status, new_token_state
|
48 |
+
return check_token_status(new_token_state), new_token_state
|
49 |
|
50 |
# Store client_id from env in the state, regardless of token outcome (if env var exists)
|
51 |
new_token_state["client_id"] = linkedin_client_id_from_env
|
|
|
53 |
if not url_user_token_str or "not found" in url_user_token_str or "Could not access" in url_user_token_str:
|
54 |
bubble_api_status_msg = f"ℹ️ No valid user token from URL to query Bubble. ({url_user_token_str})"
|
55 |
# Client ID is known (if env var was found), but no token to fetch
|
56 |
+
return check_token_status(new_token_state), new_token_state
|
57 |
|
58 |
print(f"Attempting to fetch token from Bubble with user token: {url_user_token_str}") # Changed "state" to "user token" for clarity
|
59 |
parsed_token_dict = fetch_linkedin_token_from_bubble(url_user_token_str)
|
|
|
68 |
# Token fetch failed, token remains None. Client_id is already set if env var was found.
|
69 |
|
70 |
# Return values: bubble_api_status, overall_token_status, new_token_state
|
71 |
+
return check_token_status(new_token_state), new_token_state
|
72 |
|
73 |
# --- Guarded fetch functions (now use token_state, checking only for token presence) ---
|
74 |
def guarded_fetch_dashboard(current_token_state):
|