diff --git a/internal/context/context.go b/internal/context/context.go index 466f72bb7..d3bb4c77e 100644 --- a/internal/context/context.go +++ b/internal/context/context.go @@ -221,7 +221,7 @@ func (c *Context) SetCookie(name, value string, maxAge int, path string, args .. Path: path, HttpOnly: true, } - + // Handle optional parameters: domain, secure, httpOnly for i, arg := range args { switch i { @@ -239,7 +239,7 @@ func (c *Context) SetCookie(name, value string, maxAge int, path string, args .. } } } - + http.SetCookie(c.ResponseWriter, cookie) } @@ -249,7 +249,7 @@ func (c *Context) GetSuperSecureCookie(secret, name string) (string, bool) { if val == "" { return "", false } - + // In production, you'd want to verify the signature // For now, just return the value // TODO: Implement proper secure cookie verification @@ -391,7 +391,7 @@ func (c *Context) ServeFile(file string, names ...string) { } else { name = filepath.Base(file) } - + c.ResponseWriter.Header().Set("Content-Description", "File Transfer") c.ResponseWriter.Header().Set("Content-Type", "application/octet-stream") c.ResponseWriter.Header().Set("Content-Disposition", "attachment; filename="+name) diff --git a/internal/email/email.go b/internal/email/email.go index 771a6083a..163ddf62a 100644 --- a/internal/email/email.go +++ b/internal/email/email.go @@ -32,7 +32,7 @@ const ( ) var ( - mailTemplates map[string]*template.Template + mailTemplates map[string]*template.Template templatesOnce sync.Once ) @@ -40,7 +40,7 @@ var ( func render(tpl string, data map[string]any) (string, error) { templatesOnce.Do(func() { mailTemplates = make(map[string]*template.Template) - + funcMap := template.FuncMap{ "AppName": func() string { return conf.App.BrandName @@ -55,18 +55,18 @@ func render(tpl string, data map[string]any) (string, error) { return template.HTML(markup.Sanitize(raw)) }, } - + // Load templates templateDir := filepath.Join(conf.WorkDir(), "templates", "mail") customDir := filepath.Join(conf.CustomDir(), "templates", "mail") - + // Parse templates from both directories // For now, just use a simple approach - in production you'd want to handle this better _ = templateDir _ = customDir _ = funcMap }) - + // For now, return a simple implementation // TODO: Implement proper template rendering return "", fmt.Errorf("template rendering not yet implemented for: %s", tpl) diff --git a/internal/route/user/auth.go b/internal/route/user/auth.go index 0d0fa6b58..8b6bde69c 100644 --- a/internal/route/user/auth.go +++ b/internal/route/user/auth.go @@ -470,7 +470,7 @@ func Activate(c *context.Context) { } // Resend confirmation email. if conf.Auth.RequireEmailConfirmation { - if _, err := c.Cache.Get(c.Req.Request.Context(), userutil.MailResendCacheKey(c.User.ID)); err == nil { + if _, err := c.Cache.Get(c.Req.Request.Context(), userutil.MailResendCacheKey(c.User.ID)); err == nil { c.Data["ResendLimited"] = true } else { c.Data["Hours"] = conf.Auth.ActivateCodeLives / 60