remove images on login for mobile

This commit is contained in:
Ra
2025-09-23 13:24:15 -07:00
parent 5b5bf76c9a
commit a96df00606
10 changed files with 2127 additions and 6622 deletions

View File

@@ -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) {