render html change templ

This commit is contained in:
2024-12-11 17:11:53 +08:00
parent cff64975d7
commit e9876b0c6f
65 changed files with 1548 additions and 475 deletions

View File

@@ -0,0 +1,11 @@
package funcs
import (
"context"
"github.com/zhang2092/go-url-shortener/internal/middleware"
)
func GetAuthorize(ctx context.Context) *middleware.Authorize {
return middleware.GetUser(ctx)
}

View File

@@ -0,0 +1,12 @@
package funcs
import (
"html/template"
"net/http"
"github.com/gorilla/csrf"
)
func CsrfField(r *http.Request) template.HTML {
return csrf.TemplateField(r)
}