diff --git a/backend/src/controllers/settings.controller.js b/backend/src/controllers/settings.controller.js index 25aaa86..0f68671 100644 --- a/backend/src/controllers/settings.controller.js +++ b/backend/src/controllers/settings.controller.js @@ -30,16 +30,18 @@ exports.updateGmailSettings = async (req, res, next) => { if (gmail_user) { await Settings.upsert({ key: 'gmail_user', - value: gmail_user, + value: gmail_user.trim(), is_encrypted: false, description: 'Gmail email address', }); } if (gmail_app_password) { + // Remove all spaces from App Password (Google gives it with spaces) + const cleanPassword = gmail_app_password.replace(/\s+/g, ''); await Settings.upsert({ key: 'gmail_password', - value: gmail_app_password, + value: cleanPassword, is_encrypted: true, description: 'Gmail App Password', });