Skip to content

Commit

Permalink
Fix send email
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed May 19, 2024
1 parent 255ecf3 commit 71b5bbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion MagicalAuth.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ def send_magic_link(self, otp, ip_address):
if os.environ.get("SENDGRID_API_KEY"):
send_email(
email=self.email,
message=f"<a href='{self.link}?email={self.email}&token={self.token}'>Click here to log in</a>",
subject="Magic Link",
body=f"<a href='{self.link}?email={self.email}&token={self.token}'>Click here to log in</a>",
)
else:
return f"{self.link}?email={self.email}&token={self.token}"
Expand Down
3 changes: 2 additions & 1 deletion UI.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ def login_page():
if confirm_button:
otp = pyotp.TOTP(mfa_token).verify(mfa_confirm)
if otp:
st.write(
st.success(
"MFA token confirmed! Please check your email for the login link."
)
auth.send_magic_link(otp=otp)
st.stop()
else:
st.write("Invalid MFA token. Please try again.")
st.stop()
Expand Down

0 comments on commit 71b5bbb

Please sign in to comment.