Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -284,6 +284,20 @@ if st.session_state.get("jwt_token"):
|
|
284 |
else:
|
285 |
is_free_tier = True # Default to free tier if not logged in
|
286 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
# Show appropriate duration slider based on subscription tier
|
288 |
if is_free_tier:
|
289 |
duration = st.slider(
|
|
|
284 |
else:
|
285 |
is_free_tier = True # Default to free tier if not logged in
|
286 |
|
287 |
+
# Add this debug section before the duration slider
|
288 |
+
if st.session_state.get("jwt_token"):
|
289 |
+
auth_headers = get_auth_headers()
|
290 |
+
subscription_url = "https://songlabai.com/wp-json/custom-api/v1/subscription"
|
291 |
+
response = requests.get(subscription_url, headers=auth_headers)
|
292 |
+
|
293 |
+
if response.status_code == 200:
|
294 |
+
data = response.json()
|
295 |
+
st.write("Debug Info:")
|
296 |
+
st.json(data) # This will show the full API response
|
297 |
+
st.write(f"Is Free Tier: {not data.get('subscription_plan_id') or data.get('subscription_plan_id') == 576}")
|
298 |
+
else:
|
299 |
+
st.write(f"API Error: {response.status_code}")
|
300 |
+
|
301 |
# Show appropriate duration slider based on subscription tier
|
302 |
if is_free_tier:
|
303 |
duration = st.slider(
|