Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

100
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda