prepare("SELECT id FROM users WHERE email = ? LIMIT 1"); $stmt->execute([$email]); $user = $stmt->fetch(); if ($user) { $token = bin2hex(random_bytes(32)); $expires = date('Y-m-d H:i:s', strtotime('+1 hour')); $stmt = db()->prepare("INSERT INTO password_resets (email, token, expires_at) VALUES (?, ?, ?)"); $stmt->execute([$email, $token, $expires]); // Send Email $resetLink = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]/reset_password.php?token=$token"; $subject = "Password Reset Request"; $html = "

Password Reset Request

We received a request to reset your password for SR&ED Manager.

Click the link below to set a new password. This link will expire in 1 hour.

Reset Password

If you did not request this, please ignore this email.

"; $text = "Reset your password by clicking this link: $resetLink"; MailService::sendMail($email, $subject, $html, $text); } // Always show success to prevent email enumeration $success = true; } ?> Forgot Password - SR&ED Manager

RESET PASSWORD

Enter your email to receive a reset link

If an account exists with that email, you will receive a password reset link shortly.
Back to Login