initializing user

This commit is contained in:
counter 2023-01-16 22:25:51 -08:00
parent d01cc488d3
commit 5d2c15ad59
2 changed files with 5 additions and 5 deletions

4
app.js
View file

@ -257,9 +257,9 @@ async function get_app_server() {
console.log("saved record");
// Send out notification via configured notification channel
if(process.env.SMTP_EMAIL_NOTIFICATIONS_ENABLED === "true") {
if(user.sendEmailAlerts) {
payload_fire_data.screenshot_url = `https://${process.env.HOSTNAME}/screenshots/${payload_fire_data.screenshot_id}.png`;
await notification.send_email_notification(payload_fire_data);
await notification.send_email_notification(payload_fire_data, user.email);
}
});

View file

@ -7,7 +7,7 @@ const XSS_PAYLOAD_FIRE_EMAIL_TEMPLATE = fs.readFileSync(
'utf8'
);
async function send_email_notification(xss_payload_fire_data) {
async function send_email_notification(xss_payload_fire_data, email) {
const transporter = nodemailer.createTransport({
host: process.env.SMTP_HOST,
port: parseInt(process.env.SMTP_PORT),
@ -25,7 +25,7 @@ async function send_email_notification(xss_payload_fire_data) {
const info = await transporter.sendMail({
from: process.env.SMTP_FROM_EMAIL,
to: process.env.SMTP_RECEIVER_EMAIL,
to: email,
subject: `[XSS Hunter Express] XSS Payload Fired On ${xss_payload_fire_data.url}`,
text: "Only HTML reports are available, please use an email client which supports this.",
html: notification_html_email_body,
@ -34,4 +34,4 @@ async function send_email_notification(xss_payload_fire_data) {
console.log("Message sent: %s", info.messageId);
}
module.exports.send_email_notification = send_email_notification;
module.exports.send_email_notification = send_email_notification;