Add email confirmation

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-03-12 12:17:21 +01:00
parent 0e44d39998
commit 1a6e68f13c
11 changed files with 709 additions and 18 deletions

View File

@@ -48,11 +48,12 @@ type (
}
config struct {
Pg pgConfig `json:"pg"`
Api apiConfig `json:"api"`
Auth authConfig `json:"auth"`
AWS awsConfig `json:"aws"`
Mailer mailerConfig `json:"mailer"`
Hostname string `json:"hostname"`
Pg pgConfig `json:"pg"`
Api apiConfig `json:"api"`
Auth authConfig `json:"auth"`
AWS awsConfig `json:"aws"`
Mailer mailerConfig `json:"mailer"`
}
)
@@ -64,6 +65,7 @@ var (
func New() *Implm {
return &Implm{
cfg: config{
Hostname: "localhost:8080",
Api: apiConfig{
Addr: "localhost:8080",
Cors: corsConfig{
@@ -170,7 +172,13 @@ func (impl *Implm) Run(
return fmt.Errorf("cannot create hashing profile: %w", err)
}
usrmgrService, err := usrmgr.NewService(ctx, pgClient, hp)
usrmgrService, err := usrmgr.NewService(
ctx,
pgClient,
hp,
impl.cfg.Auth.Cookie.Secret,
impl.cfg.Hostname,
)
if err != nil {
return fmt.Errorf("cannot create usrmgr service: %w", err)
}