Cleanup configuration.
This commit is contained in:
parent
77cabe5f12
commit
a53bdf9a1b
3 changed files with 7 additions and 6 deletions
|
|
@ -93,7 +93,6 @@ type (
|
||||||
Capacity int
|
Capacity int
|
||||||
Expiration struct {
|
Expiration struct {
|
||||||
StaticFile time.Duration
|
StaticFile time.Duration
|
||||||
Page time.Duration
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ cache:
|
||||||
capacity: 100000
|
capacity: 100000
|
||||||
expiration:
|
expiration:
|
||||||
staticFile: "4380h"
|
staticFile: "4380h"
|
||||||
page: "24h"
|
|
||||||
|
|
||||||
database:
|
database:
|
||||||
driver: "sqlite3"
|
driver: "sqlite3"
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import (
|
||||||
|
|
||||||
"github.com/go-playground/validator/v10"
|
"github.com/go-playground/validator/v10"
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
|
"github.com/mikestefanello/pagoda/config"
|
||||||
"github.com/mikestefanello/pagoda/ent"
|
"github.com/mikestefanello/pagoda/ent"
|
||||||
"github.com/mikestefanello/pagoda/ent/user"
|
"github.com/mikestefanello/pagoda/ent/user"
|
||||||
"github.com/mikestefanello/pagoda/pkg/context"
|
"github.com/mikestefanello/pagoda/pkg/context"
|
||||||
|
|
@ -22,6 +23,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Auth struct {
|
type Auth struct {
|
||||||
|
config *config.Config
|
||||||
auth *services.AuthClient
|
auth *services.AuthClient
|
||||||
mail *services.MailClient
|
mail *services.MailClient
|
||||||
orm *ent.Client
|
orm *ent.Client
|
||||||
|
|
@ -32,6 +34,7 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Auth) Init(c *services.Container) error {
|
func (h *Auth) Init(c *services.Container) error {
|
||||||
|
h.config = c.Config
|
||||||
h.orm = c.ORM
|
h.orm = c.ORM
|
||||||
h.auth = c.Auth
|
h.auth = c.Auth
|
||||||
h.mail = c.Mail
|
h.mail = c.Mail
|
||||||
|
|
@ -111,7 +114,7 @@ func (h *Auth) ForgotPasswordSubmit(ctx echo.Context) error {
|
||||||
Compose().
|
Compose().
|
||||||
To(u.Email).
|
To(u.Email).
|
||||||
Subject("Reset your password").
|
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)
|
Send(ctx)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue