Skip to content

Commit

Permalink
fix: courier
Browse files Browse the repository at this point in the history
  • Loading branch information
Benehiko committed Dec 6, 2021
1 parent 9ec6b70 commit 488640c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
8 changes: 5 additions & 3 deletions cmd/courier/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ package courier

import (
cx "context"
"net/http"

"github.com/spf13/cobra"
"github.com/urfave/negroni"

"github.com/ory/graceful"
"github.com/ory/kratos/driver"
"github.com/ory/kratos/x"
"github.com/ory/x/configx"
"github.com/ory/x/reqlog"
"github.com/spf13/cobra"
"github.com/urfave/negroni"
"net/http"
)

func NewWatchCmd() *cobra.Command {
Expand Down
5 changes: 4 additions & 1 deletion courier/courier.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type (
SMTPDependencies interface {
PersistenceProvider
x.LoggingProvider
CourierConfig(ctx context.Context) SMTPConfig
ConfigProvider
}
TemplateTyper func(t EmailTemplate) (TemplateType, error)
EmailTemplateFromMessage func(c SMTPConfig, msg Message) (EmailTemplate, error)
Expand All @@ -44,6 +44,9 @@ type (
Provider interface {
Courier(ctx context.Context) *Courier
}
ConfigProvider interface {
CourierConfig(ctx context.Context) SMTPConfig
}
)

func NewSMTP(ctx context.Context, d SMTPDependencies) *Courier {
Expand Down
9 changes: 3 additions & 6 deletions driver/registry_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"sync"
"time"

"github.com/gobuffalo/pop/v5"

"github.com/ory/nosurf"

"github.com/ory/kratos/selfservice/strategy/webauthn"
Expand All @@ -22,8 +24,6 @@ import (

prometheus "github.com/ory/x/prometheusx"

"github.com/gobuffalo/pop/v5"

"github.com/ory/kratos/cipher"
"github.com/ory/kratos/continuity"
"github.com/ory/kratos/hash"
Expand Down Expand Up @@ -260,10 +260,7 @@ func (m *RegistryDefault) Config(ctx context.Context) *config.Config {
}

func (m *RegistryDefault) CourierConfig(ctx context.Context) courier.SMTPConfig {
if m.c == nil {
panic("configuration not set")
}
return corp.ContextualizeConfig(ctx, m.c)
return m.Config(ctx)
}

func (m *RegistryDefault) SMTPConfig(ctx context.Context) courier.SMTPConfig {
Expand Down

0 comments on commit 488640c

Please sign in to comment.