'Error: Invalid login: 534-5.7.9 Application-specific password required. Learn more at

Since google is removing less secure app mode, I'm changing the password settings for my app (which is written in flutter/Firebase) from the actual google password, to a password which I generate inside the setting of my google account to give full access. So I set the password like that

firebase functions:config:set gmail.email=email gmail.password=passwort

I checked everything twice with

firebase functions:config:get

and now wanna tried. But the problem that I have is that its always saying

 Error: Invalid login: 534-5.7.9 Application-specific password required. Learn more at 

This is my functions

import * as functions from "firebase-functions";
import nodemailer from "nodemailer";

const { email = "", password = "" } = functions.config().gmail || {};

const mailTransport = nodemailer.createTransport(
  `smtps://${email}:${password}@smtp.gmail.com`
);


const senEmail = async (email, subject, text) => {
  try {
  const mailOptions = {
    from: `"-IMPORTANT" <${email}>`,
    to: email,
    subject,
    text,
  };

  return mailTransport.sendMail(mailOptions);
} catch (error) {
  console.log("error", error);
  res.status(501).send(`Fehler! `);
  return;
}
};

export { senEmail };

I have to say I don't use google sign in for my app. Is this maybe a problem?



Solution 1:[1]

Ok I fixed it. What I did was first making sure to do all the steps which are written in this blog

1.http://help.warmupinbox.com/en/articles/4934806-configure-for-google-workplace-with-two-factor-authentication-2fa .

2.Then make sure that you redeploy the functions.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Michael m.