Spaces:
Sleeping
Sleeping
Gouzi Mohaled
commited on
Commit
·
48ba28f
1
Parent(s):
a802c13
modification de la fonction send_verification_email dans app.py pour Choisir le protocole (http ou https) en fonction de la présence de 'localhost' dans l'URL
Browse files
app.py
CHANGED
@@ -875,13 +875,16 @@ def send_verification_email(email: str, token: str) -> bool:
|
|
875 |
subject = "Vérification de votre compte"
|
876 |
# Utiliser directement localhost:8501 sans http://
|
877 |
base_url = os.getenv('APP_URL', '').rstrip('/')
|
|
|
|
|
|
|
|
|
878 |
# Construire l'URL avec le format correct pour Streamlit
|
879 |
-
if base_url.startswith(
|
880 |
verification_url = f"{base_url}/Verify_email?token={token}"
|
881 |
else:
|
882 |
-
verification_url = f"
|
883 |
# Note: "Verify_email" correspond au nom de la page dans Streamlit (le nom du fichier sans .py)
|
884 |
-
|
885 |
html_content = f"""
|
886 |
<html>
|
887 |
<body>
|
|
|
875 |
subject = "Vérification de votre compte"
|
876 |
# Utiliser directement localhost:8501 sans http://
|
877 |
base_url = os.getenv('APP_URL', '').rstrip('/')
|
878 |
+
if "localhost" in base_url:
|
879 |
+
protocol = "http://"
|
880 |
+
else:
|
881 |
+
protocol = "https://"
|
882 |
# Construire l'URL avec le format correct pour Streamlit
|
883 |
+
if base_url.startswith(protocol):
|
884 |
verification_url = f"{base_url}/Verify_email?token={token}"
|
885 |
else:
|
886 |
+
verification_url = f"{protocol}{base_url}/Verify_email?token={token}"
|
887 |
# Note: "Verify_email" correspond au nom de la page dans Streamlit (le nom du fichier sans .py)
|
|
|
888 |
html_content = f"""
|
889 |
<html>
|
890 |
<body>
|