feat: smtp server for sending email can now be set by config

This commit is contained in:
Jordan Knott
2020-12-23 16:44:13 -06:00
parent e25a426e7b
commit 9f27bd157f
7 changed files with 131 additions and 87 deletions

View File

@ -26,10 +26,11 @@ import (
)
// NewHandler returns a new graphql endpoint handler.
func NewHandler(repo db.Repository) http.Handler {
func NewHandler(repo db.Repository, emailConfig utils.EmailConfig) http.Handler {
c := Config{
Resolvers: &Resolver{
Repository: repo,
Repository: repo,
EmailConfig: emailConfig,
},
}
c.Directives.HasRole = func(ctx context.Context, obj interface{}, next graphql.Resolver, roles []RoleLevel, level ActionLevel, typeArg ObjectType) (interface{}, error) {