From c9ff811cc1c72e06586e931f14bc0085f5311f59 Mon Sep 17 00:00:00 2001 From: salvacybersec Date: Mon, 10 Nov 2025 19:27:20 +0300 Subject: [PATCH] fix: Auto-remove spaces from Gmail App Password - Google provides App Password with spaces (e.g. 'abcd efgh ijkl mnop') - Backend now automatically removes all spaces before saving - Users can paste password directly from Google without manual cleanup - Also trim gmail_user for safety --- backend/src/controllers/settings.controller.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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', });