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:
@@ -25,7 +25,7 @@ exports.getAllSettings = async (req, res, next) => {
|
||||
// Update Gmail settings
|
||||
exports.updateGmailSettings = async (req, res, next) => {
|
||||
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) {
|
||||
await Settings.upsert({
|
||||
@@ -36,10 +36,10 @@ exports.updateGmailSettings = async (req, res, next) => {
|
||||
});
|
||||
}
|
||||
|
||||
if (gmail_password) {
|
||||
if (gmail_app_password) {
|
||||
await Settings.upsert({
|
||||
key: 'gmail_password',
|
||||
value: gmail_password,
|
||||
value: gmail_app_password,
|
||||
is_encrypted: true,
|
||||
description: 'Gmail App Password',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user