fix: Gmail App Password parameter name in settings controller

- Changed gmail_password to gmail_app_password in request body destructuring
- Matches frontend Settings.jsx which sends gmail_app_password
- Backend still stores as 'gmail_password' key in database (for backward compatibility)
This commit is contained in:
salvacybersec
2025-11-10 19:24:49 +03:00
parent 37e9745a4d
commit ce31698cc4

View File

@@ -25,7 +25,7 @@ exports.getAllSettings = async (req, res, next) => {
// Update Gmail settings // Update Gmail settings
exports.updateGmailSettings = async (req, res, next) => { exports.updateGmailSettings = async (req, res, next) => {
try { try {
const { gmail_user, gmail_password, gmail_from_name } = req.body; const { gmail_user, gmail_app_password, gmail_from_name } = req.body;
if (gmail_user) { if (gmail_user) {
await Settings.upsert({ await Settings.upsert({
@@ -36,10 +36,10 @@ exports.updateGmailSettings = async (req, res, next) => {
}); });
} }
if (gmail_password) { if (gmail_app_password) {
await Settings.upsert({ await Settings.upsert({
key: 'gmail_password', key: 'gmail_password',
value: gmail_password, value: gmail_app_password,
is_encrypted: true, is_encrypted: true,
description: 'Gmail App Password', description: 'Gmail App Password',
}); });