Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

95
Vistas
Mailgun account deactivated after commiting to GitHub

So, I was making a small login app where the user registers, then an verification token gets sent to the email he registered with to verify that he is the owner of that email.

Everything worked fine locally, after I uploaded my repo to GitHub, my MailGun account was deactivated due to "exposed credentials".

MailGun.js requires your MG domain and the private_key(I think?) to send an email (of course and the user's email) . That's what I used and it worked fine before.

If I'm going to upload this small app, what should I use to protect my credentials and send those verification mails? I used to public key which didn't work, and both private_key and HTTP webhook signing key work fine, but I want to know more about this and how to secure it.

Thanks!

Oh Code:

const mailgun = require('mailgun-js');

const sendVerificationMail = function(email, email_Token){
  const domain = DOMAIN_HERE;

  const mg = mailgun({
    apiKey: API_KEY,
    domain,
  })
  
  const data = {
    from: EMAIL,
    to: email,
    subject: 'Email Confirmation',
    text: `Click on the link,: http://localhost:3000/email/validate?access=${email_Token}`,
    html: `<p>click the link: http://localhost:3000/email/validate?access=${email_Token}</p>`
  };
  
  mg.messages().send(data, function(err, res) {
    if(err) console.log(err);
    console.log(res)
  })
}

module.exports = sendVerificationMail;
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda