Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
Credenciales faltantes para "PLAIN", con un error HTTP POST 500

Estoy tratando de realizar una operación de contraseña olvidada, es decir, tratando de enviar un correo al usuario para cambiar la contraseña a través de un enlace de restablecimiento de contraseña contenido en el correo. Estoy usando el archivo .env para almacenar mi nombre de usuario, contraseñas y lo agregué a gitigonre.

código postal javascript: -

 app.post("/forgot", function (req, res, next) { async.waterfall( [ function (done) { crypto.randomBytes(20, function (err, buf) { var token = buf.toString("hex"); done(err, token); }); }, function (token, done) { User.findOne({ email: req.body.email }, function (err, user) { if (!user) { req.flash("error", "No account with that email address exists."); return res.redirect("/forgot"); } // app.get('/reset'); user.resetPasswordToken = token; user.resetPasswordExpires = Date.now() + 3600000; // 1 hour user.save(function (err) { done(err, token, user); }); }); }, function (token, user, done) { var smtpTransport = nodemailer.createTransport({ host: "smtp.gmail.com", service: "gmail", auth: { xoauth2: xoauth2.createXOAuth2Generator({ type: "OAuth2", user: process.env.Gmail_username, clientSecret: process.env.Gmail_password, }), }, tls: { ciphers: "SSLv3", }, }); var mailOptions = { from: "passwordreset@demo.com", to: user.email, subject: "Node.js Password Reset", text: "You are receiving this because you (or someone else) have requested the reset of the password for your account.\n\n" + "Please click on the following link, or paste this into your browser to complete the process:\n\n" + "http://" + req.headers.host + "/reset/" + token + "\n\n" + "If you did not request this, please ignore this email and your password will remain unchanged.\n", }; smtpTransport.sendMail(mailOptions, function (err) { req.flash( "info", "An e-mail has been sent to " + user.email + " with further instructions." ); done(err, "done"); }); }, ], function (err) { if (err) return next(err); res.redirect("/forgot"); } ); });

También he permitido el acceso a las aplicaciones menos seguras para la dirección de correo electrónico. La clave secreta del cliente es generada por la cuenta de Google, no es la contraseña de mi cuenta de Gmail, solo lleva el nombre de eso. ¿Puede alguien sugerir, lo que estoy haciendo mal ..

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!