Spaces:
Running
Running
Tu Nombre commited on
Commit ·
05fb8be
1
Parent(s): 51a3586
fix oauth repo y indentacion
Browse files
main.py
CHANGED
|
@@ -171,7 +171,7 @@ CMD [\"uvicorn\", \"main:app\", \"--host\", \"0.0.0.0\", \"--port\", \"7860\"]""
|
|
| 171 |
|
| 172 |
hf_user_space = f"{hf_user_actual}/{space_id}".replace("/", "-").lower()
|
| 173 |
url = f"https://{hf_user_space}.hf.space"
|
| 174 |
-
CLIENTES[email] = {"nicho": nicho, "url": url}
|
| 175 |
guardar_clientes()
|
| 176 |
enviar_email(email, nicho, url)
|
| 177 |
return url
|
|
@@ -642,7 +642,7 @@ async def oauth_callback(code: str, state: str):
|
|
| 642 |
return HTMLResponse("<h2>❌ Error al obtener token</h2>")
|
| 643 |
# Guardar token en el Space del cliente
|
| 644 |
if email in CLIENTES:
|
| 645 |
-
space_repo = CLIENTES[email]
|
| 646 |
headers = {"Authorization": f"Bearer {HF_TOKEN}"}
|
| 647 |
import json
|
| 648 |
async with httpx.AsyncClient() as client:
|
|
|
|
| 171 |
|
| 172 |
hf_user_space = f"{hf_user_actual}/{space_id}".replace("/", "-").lower()
|
| 173 |
url = f"https://{hf_user_space}.hf.space"
|
| 174 |
+
CLIENTES[email] = {"nicho": nicho, "url": url, "repo": repo_name}
|
| 175 |
guardar_clientes()
|
| 176 |
enviar_email(email, nicho, url)
|
| 177 |
return url
|
|
|
|
| 642 |
return HTMLResponse("<h2>❌ Error al obtener token</h2>")
|
| 643 |
# Guardar token en el Space del cliente
|
| 644 |
if email in CLIENTES:
|
| 645 |
+
space_repo = CLIENTES[email].get("repo", "")
|
| 646 |
headers = {"Authorization": f"Bearer {HF_TOKEN}"}
|
| 647 |
import json
|
| 648 |
async with httpx.AsyncClient() as client:
|