mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
feat: WIP auth mailing implementation
This commit is contained in:
@@ -3,6 +3,7 @@ package route
|
||||
import (
|
||||
"GohCMS2/api"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/MadAppGang/httplog"
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/go-chi/cors"
|
||||
@@ -33,6 +34,15 @@ func InitJwt() {
|
||||
}
|
||||
|
||||
func GetHelloWorld(w http.ResponseWriter, _ *http.Request) {
|
||||
err := api.Container.SendMailUseCase.SendMail(
|
||||
"floriansylvainpro@gmail.com",
|
||||
"mailValidation",
|
||||
struct{}{},
|
||||
)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
msg, _ := json.Marshal(map[string]string{"message": "Hello World"})
|
||||
_, _ = w.Write(msg)
|
||||
}
|
||||
|
||||
+10
-1
@@ -11,7 +11,16 @@ import (
|
||||
)
|
||||
|
||||
var possibleEnvFileLocations = []string{".env", "../.env"}
|
||||
var envVarsToLoad = []string{"PORT", "ENVIRONMENT", "CORS_ALLOWED_ORIGINS", "DB_FILE"}
|
||||
var envVarsToLoad = []string{
|
||||
"PORT",
|
||||
"ENVIRONMENT",
|
||||
"CORS_ALLOWED_ORIGINS",
|
||||
"DB_FILE",
|
||||
"SMTP_EMAIL",
|
||||
"SMTP_PASSWORD",
|
||||
"SMTP_HOST",
|
||||
"SMTP_PORT",
|
||||
}
|
||||
|
||||
func initEnvVariables() {
|
||||
var err error
|
||||
|
||||
Reference in New Issue
Block a user