From a53bdf9a1b62db5d9e7fc8f97dde1455da9c5e85 Mon Sep 17 00:00:00 2001 From: mikestefanello <552328+mikestefanello@users.noreply.github.com> Date: Tue, 22 Apr 2025 08:54:56 -0400 Subject: [PATCH] Cleanup configuration. --- config/config.go | 1 - config/config.yaml | 1 - pkg/handlers/auth.go | 11 +++++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/config/config.go b/config/config.go index 7c8853e..d62183c 100644 --- a/config/config.go +++ b/config/config.go @@ -93,7 +93,6 @@ type ( Capacity int Expiration struct { StaticFile time.Duration - Page time.Duration } } diff --git a/config/config.yaml b/config/config.yaml index 963ecbc..b5a57f7 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -28,7 +28,6 @@ cache: capacity: 100000 expiration: staticFile: "4380h" - page: "24h" database: driver: "sqlite3" diff --git a/pkg/handlers/auth.go b/pkg/handlers/auth.go index 707fe10..52fca58 100644 --- a/pkg/handlers/auth.go +++ b/pkg/handlers/auth.go @@ -6,6 +6,7 @@ import ( "github.com/go-playground/validator/v10" "github.com/labstack/echo/v4" + "github.com/mikestefanello/pagoda/config" "github.com/mikestefanello/pagoda/ent" "github.com/mikestefanello/pagoda/ent/user" "github.com/mikestefanello/pagoda/pkg/context" @@ -22,9 +23,10 @@ import ( ) type Auth struct { - auth *services.AuthClient - mail *services.MailClient - orm *ent.Client + config *config.Config + auth *services.AuthClient + mail *services.MailClient + orm *ent.Client } func init() { @@ -32,6 +34,7 @@ func init() { } func (h *Auth) Init(c *services.Container) error { + h.config = c.Config h.orm = c.ORM h.auth = c.Auth h.mail = c.Mail @@ -111,7 +114,7 @@ func (h *Auth) ForgotPasswordSubmit(ctx echo.Context) error { Compose(). To(u.Email). Subject("Reset your password"). - Body(fmt.Sprintf("Go here to reset your password: %s", url)). + Body(fmt.Sprintf("Go here to reset your password: %s", h.config.App.Host+url)). Send(ctx) if err != nil {