Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1437,5 +1437,23 @@ async def tiers():
|
|
| 1437 |
)
|
| 1438 |
|
| 1439 |
@app.get("/portal")
|
| 1440 |
-
|
| 1441 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1437 |
)
|
| 1438 |
|
| 1439 |
@app.get("/portal")
|
| 1440 |
+
@app.post("/portal")
|
| 1441 |
+
def a(request: Request):
|
| 1442 |
+
email = None
|
| 1443 |
+
|
| 1444 |
+
if request.method == "POST":
|
| 1445 |
+
try:
|
| 1446 |
+
body = await request.json()
|
| 1447 |
+
email = body.get("email")
|
| 1448 |
+
except:
|
| 1449 |
+
email = None
|
| 1450 |
+
|
| 1451 |
+
base_url = "https://billing.stripe.com/p/login/test_6oUcN5g665rp7nLgaq8bS00"
|
| 1452 |
+
|
| 1453 |
+
if not email:
|
| 1454 |
+
return RedirectResponse(url=base_url, status_code=status.HTTP_302_FOUND)
|
| 1455 |
+
|
| 1456 |
+
return RedirectResponse(
|
| 1457 |
+
url=f"{base_url}?prefilled_email={email}",
|
| 1458 |
+
status_code=status.HTTP_302_FOUND
|
| 1459 |
+
)
|