authentik/outpost/pkg/proxy/templates.go

29 lines
593 B
Go
Raw Normal View History

2020-09-02 23:04:12 +01:00
package proxy
import (
"html/template"
2020-09-30 11:03:18 +01:00
log "github.com/sirupsen/logrus"
2020-09-02 23:04:12 +01:00
)
func getTemplates() *template.Template {
2020-10-29 20:42:01 +00:00
t, err := template.New("foo").Parse(`{{define "error.html"}}
2020-09-02 23:04:12 +01:00
<!DOCTYPE html>
<html lang="en" charset="utf-8">
<head>
<title>{{.Title}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
</head>
<body>
<h2>{{.Title}}</h2>
<p>{{.Message}}</p>
<hr>
<p><a href="{{.ProxyPrefix}}/sign_in">Sign In</a></p>
</body>
</html>{{end}}`)
if err != nil {
2020-09-30 11:03:18 +01:00
log.Fatalf("failed parsing template %s", err)
2020-09-02 23:04:12 +01:00
}
return t
}