Commit c74050a8 authored by ale's avatar ale
Browse files

Delegate template loading to the App

parent ec45f260
Pipeline #421 passed with stages
in 1 minute and 18 seconds
......@@ -7,7 +7,6 @@ import (
"errors"
"flag"
"fmt"
htemplate "html/template"
"io/ioutil"
"net/http"
"path/filepath"
......@@ -184,7 +183,6 @@ func (c *serverCommand) run(ctx context.Context) error {
return fmt.Errorf("Connection to Hydra failed: %v", err)
}
htmlTpl := htemplate.Must(htemplate.ParseGlob(filepath.Join(c.templateDir, "*.html")))
emailTpl := ttemplate.Must(ttemplate.ParseGlob(filepath.Join(c.templateDir, "email", "*.txt")))
var rlConfig []byte
......@@ -205,7 +203,7 @@ func (c *serverCommand) run(ctx context.Context) error {
CSRFSecret: []byte(c.csrfSecret),
InsecureCookies: c.insecureCookies,
Database: database,
Template: htmlTpl,
TemplatePath: c.templateDir,
EmailTemplate: emailTpl,
SenderAddr: c.senderAddr,
SenderName: c.senderName,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment