refactor(admin): use go1.16 embed for templates and assets

This commit is contained in:
sentriz
2021-05-08 15:56:33 +01:00
committed by Senan Kelly
parent 6f15589c08
commit 0c871d888b
9 changed files with 78 additions and 11322 deletions

View File

@@ -7,13 +7,13 @@ import (
"github.com/gorilla/sessions"
"go.senan.xyz/gonic"
"go.senan.xyz/gonic/server/db"
"go.senan.xyz/gonic/version"
)
func (c *Controller) WithSession(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
session, err := c.sessDB.Get(r, version.NAME)
session, err := c.sessDB.Get(r, gonic.Name)
if err != nil {
http.Error(w, fmt.Sprintf("error getting session: %s", err), 500)
return