Move SMTP credentials to .env file

This commit is contained in:
2024-04-27 15:43:11 +07:00
parent 2e48192a35
commit dfaf8e999f
4 changed files with 13 additions and 2 deletions

View File

@ -16,6 +16,7 @@ import (
"github.com/google/uuid"
"gorm.io/gorm"
"net/http"
"strconv"
"sync"
"time"
)
@ -34,7 +35,8 @@ var VerifyEmail map[string]string
func init() {
log = logger.Logger()
mailServer = email.NewSmtpServer("mail.fossy.my.id", 25, "test@fossy.my.id", "Test123456")
smtpPort, _ := strconv.Atoi(utils.Getenv("SMTP_PORT"))
mailServer = email.NewSmtpServer(utils.Getenv("SMTP_HOST"), smtpPort, utils.Getenv("SMTP_USER"), utils.Getenv("SMTP_PASSWORD"))
VerifyUser = make(map[string]*UnverifiedUser)
VerifyEmail = make(map[string]string)