Skip to content

Commit e85ca0a

Browse files
Cleanup configuration.
1 parent 8d6f0b1 commit e85ca0a

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

config/config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ type (
9393
Capacity int
9494
Expiration struct {
9595
StaticFile time.Duration
96-
Page time.Duration
9796
}
9897
}
9998

config/config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ cache:
2828
capacity: 100000
2929
expiration:
3030
staticFile: "4380h"
31-
page: "24h"
3231

3332
database:
3433
driver: "sqlite3"

pkg/handlers/auth.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
"github.com/go-playground/validator/v10"
88
"github.com/labstack/echo/v4"
9+
"github.com/mikestefanello/pagoda/config"
910
"github.com/mikestefanello/pagoda/ent"
1011
"github.com/mikestefanello/pagoda/ent/user"
1112
"github.com/mikestefanello/pagoda/pkg/context"
@@ -22,16 +23,18 @@ import (
2223
)
2324

2425
type Auth struct {
25-
auth *services.AuthClient
26-
mail *services.MailClient
27-
orm *ent.Client
26+
config *config.Config
27+
auth *services.AuthClient
28+
mail *services.MailClient
29+
orm *ent.Client
2830
}
2931

3032
func init() {
3133
Register(new(Auth))
3234
}
3335

3436
func (h *Auth) Init(c *services.Container) error {
37+
h.config = c.Config
3538
h.orm = c.ORM
3639
h.auth = c.Auth
3740
h.mail = c.Mail
@@ -111,7 +114,7 @@ func (h *Auth) ForgotPasswordSubmit(ctx echo.Context) error {
111114
Compose().
112115
To(u.Email).
113116
Subject("Reset your password").
114-
Body(fmt.Sprintf("Go here to reset your password: %s", url)).
117+
Body(fmt.Sprintf("Go here to reset your password: %s", h.config.App.Host+url)).
115118
Send(ctx)
116119

117120
if err != nil {

0 commit comments

Comments
 (0)