I have a node.js application that sends out gmail notifications for certain events. We recently switched from being directly hosted on DO to a Kubernetes cluster. After we switched, we started getting invalid login exceptions in the Node.js app and critical security alerts from Google. After researching the issue, we turned the "Less secure app access" setting on. Now, we are getting the error message that says "Please log in via your web browser and then try again."
I'm not sure where to go from here since I can't log in with a web browser from my Kubernetes cluster.
My code looks like this.
const nodemailer = require('nodemailer');
const mailer = nodemailer.createTransport(config.email);
...
req.app.locals.mailer.sendMail({
from: 'myaddress@gmail.com',
to: emails,
subject: subject + " " + serverName,
text: message,
});
Note that the code was working before the move to kubernetes.
Thanks in advance for your help.
Answered in comments, user did need to log into Google to acknowledge a blocker message.