17 lines
229 B
Go
17 lines
229 B
Go
package util
|
|
|
|
import (
|
|
"html/template"
|
|
"net/http"
|
|
|
|
"github.com/gorilla/csrf"
|
|
)
|
|
|
|
func CsrfField(r *http.Request) template.HTML {
|
|
return csrf.TemplateField(r)
|
|
}
|
|
|
|
func CsrfToken(r *http.Request) string {
|
|
return csrf.Token(r)
|
|
}
|