Hashing password

Using postgres' pgcrypt
This commit is contained in:
cdricms
2025-01-17 10:39:59 +01:00
parent 89f44f4469
commit fdc3122b68
7 changed files with 88 additions and 28 deletions

View File

@@ -3,6 +3,7 @@ package main
import (
"fmt"
"github.com/joho/godotenv"
"github.com/uptrace/bun/extra/bundebug"
"log"
"net/http"
"os"
@@ -23,6 +24,7 @@ func main() {
log.Fatalf("Error loading .env file: %v", err)
}
environ := os.Getenv("ENVIRONMENT")
port := os.Getenv("BACKEND_DOCKER_PORT")
if environ == "DEV" {
port = os.Getenv("BACKEND_PORT")
@@ -41,6 +43,10 @@ func main() {
log.Fatal(err)
}
core.DB.AddQueryHook(bundebug.NewQueryHook(bundebug.WithVerbose(true)))
defer core.DB.Close()
mux := http.NewServeMux()
core.HandleRoutes(mux, map[string]core.Handler{