remove images on login for mobile
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const { onRequest } = require("firebase-functions/v2/https");
|
||||
const { setGlobalOptions, logger } = require("firebase-functions/v2");
|
||||
const { VertexAI } = require('@google-cloud/vertexai');
|
||||
const { SMTPTransport } = require('nodemailer/lib/smtp-transport');
|
||||
const Stripe = require("stripe");
|
||||
const nodemailer = require('nodemailer');
|
||||
const { executeQuery, executeTransaction } = require('./database');
|
||||
@@ -32,7 +33,7 @@ const stripe = process.env.STRIPE_SECRET_KEY ? new Stripe(process.env.STRIPE_SEC
|
||||
}) : null;
|
||||
|
||||
// Initialize nodemailer transporter
|
||||
const emailTransporter = process.env.EMAIL_HOST ? nodemailer.createTransport({
|
||||
const emailTransport = nodemailer.createTransport({
|
||||
host: process.env.EMAIL_HOST,
|
||||
port: parseInt(process.env.EMAIL_PORT || '465'),
|
||||
secure: true, // Use SSL
|
||||
@@ -40,7 +41,7 @@ const emailTransporter = process.env.EMAIL_HOST ? nodemailer.createTransport({
|
||||
user: process.env.EMAIL_USER,
|
||||
pass: process.env.EMAIL_PASS
|
||||
}
|
||||
}) : null;
|
||||
});
|
||||
//endregion Interface Clients
|
||||
|
||||
//region Constants
|
||||
@@ -713,7 +714,7 @@ const verifyUserAuthorization = async (userId, orgId) => {
|
||||
|
||||
// Email service helper function
|
||||
const sendEmail = async (to, subject, htmlContent, textContent = null) => {
|
||||
if (!emailTransporter) {
|
||||
if (!emailTransport) {
|
||||
console.warn('Email transporter not configured. Email not sent.');
|
||||
return false;
|
||||
}
|
||||
@@ -730,7 +731,7 @@ const sendEmail = async (to, subject, htmlContent, textContent = null) => {
|
||||
text: textContent || htmlContent.replace(/<[^>]*>/g, '') // Strip HTML for text version
|
||||
};
|
||||
|
||||
const result = await emailTransporter.sendMail(mailOptions);
|
||||
const result = await emailTransport.sendMail(mailOptions);
|
||||
console.log(`✅ Email sent successfully to ${to}: ${result.messageId}`);
|
||||
return true;
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user