Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,8 @@ import smtplib
|
|
7 |
from email.mime.text import MIMEText
|
8 |
# Load Firebase credentials from Hugging Face Secrets
|
9 |
firebase_creds = os.getenv("FIREBASE_CREDENTIALS")
|
|
|
|
|
10 |
if firebase_creds:
|
11 |
firebase_creds = json.loads(firebase_creds)
|
12 |
else:
|
@@ -24,8 +26,6 @@ if "current_user" not in st.session_state:
|
|
24 |
|
25 |
# Function to send verification email
|
26 |
def send_verification_email(email, verification_link):
|
27 |
-
sender_email = "[email protected]"
|
28 |
-
sender_password = "your_email_password"
|
29 |
subject = "Verify Your Email"
|
30 |
body = f"Please click the link to verify your email: {verification_link}"
|
31 |
|
@@ -35,7 +35,7 @@ def send_verification_email(email, verification_link):
|
|
35 |
msg['To'] = email
|
36 |
|
37 |
with smtplib.SMTP_SSL('smtp.example.com', 465) as server:
|
38 |
-
server.login(sender_email,
|
39 |
server.sendmail(sender_email, [email], msg.as_string())
|
40 |
|
41 |
# Callback for registration
|
|
|
7 |
from email.mime.text import MIMEText
|
8 |
# Load Firebase credentials from Hugging Face Secrets
|
9 |
firebase_creds = os.getenv("FIREBASE_CREDENTIALS")
|
10 |
+
sender_email = os.getenv("email")
|
11 |
+
email_pass = os.getenv("email_pass")
|
12 |
if firebase_creds:
|
13 |
firebase_creds = json.loads(firebase_creds)
|
14 |
else:
|
|
|
26 |
|
27 |
# Function to send verification email
|
28 |
def send_verification_email(email, verification_link):
|
|
|
|
|
29 |
subject = "Verify Your Email"
|
30 |
body = f"Please click the link to verify your email: {verification_link}"
|
31 |
|
|
|
35 |
msg['To'] = email
|
36 |
|
37 |
with smtplib.SMTP_SSL('smtp.example.com', 465) as server:
|
38 |
+
server.login(sender_email, email_pass)
|
39 |
server.sendmail(sender_email, [email], msg.as_string())
|
40 |
|
41 |
# Callback for registration
|