FEAT: Added get_email util
UPDATE: Updated forgot password email route, changed send_email from a route to an internal function
This commit is contained in:
@@ -123,4 +123,14 @@ def reset_password(new_password: str, email: str) -> bool:
|
||||
WHERE email = ?
|
||||
""", (generate_password_hash(new_password), email))
|
||||
|
||||
return True
|
||||
return True
|
||||
|
||||
def get_email(user_id: int) -> Optional[str]:
|
||||
with Database() as db:
|
||||
email = db.fetchone("""
|
||||
SELECT email
|
||||
FROM users
|
||||
WHERE user_id = ?
|
||||
""", (user_id,))
|
||||
|
||||
return email["email"] if email else None
|
||||
Reference in New Issue
Block a user