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

94
Views
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
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!