UPDATE: Updated VideoPage UI

UPDATE: Added response to successful password reset redirect to homepage
This commit is contained in:
JustIceO7
2025-02-14 00:14:16 +00:00
parent 9bd1e249ed
commit 88c9b168fd
9 changed files with 98 additions and 78 deletions

View File

@@ -31,7 +31,7 @@ def verify_token(token: str, salt_value) -> Optional[str]:
print("Token is invalid", flush=True)
return None
def reset_password(new_password: str, email: str) -> bool:
def reset_password(new_password: str, email: str):
"""
Given email and new password reset the password for a given user
"""
@@ -41,5 +41,3 @@ def reset_password(new_password: str, email: str) -> bool:
SET password = ?
WHERE email = ?
""", (generate_password_hash(new_password), email))
return True

View File

@@ -12,6 +12,9 @@ r = redis.from_url(redis_url, decode_responses=True)
load_dotenv()
url = getenv("HOMEPAGE_URL")
def send_email(email, func) -> None:
"""
Send a verification email to the user.
@@ -53,7 +56,6 @@ def forgot_password_body(email) -> str:
token = generate_token(email, salt)
token += "R3sET"
url = getenv("VITE_API_URL")
r.setex(token, 3600, salt)
full_url = url + "/reset_password/" + token
@@ -92,7 +94,6 @@ def confirm_account_creation_body(email) -> str:
token = generate_token(email, salt)
token += "CrEaTe"
url = getenv("VITE_API_URL")
r.setex(token, 3600, salt)
full_url = url + "/confirm_account_creation/" + token