This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/outpost/pkg/proxy/templates.go

31 lines
706 B
Go
Raw Normal View History

2020-09-02 22:04:12 +00:00
package proxy
import (
"html/template"
2020-09-30 10:03:18 +00:00
log "github.com/sirupsen/logrus"
2020-09-02 22:04:12 +00: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 22:04:12 +00: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">
<style>* { font-family: sans-serif; }</style>
2020-09-02 22:04:12 +00:00
</head>
<body>
<h2>{{.Title}}</h2>
<p>{{.Message}}</p>
<hr>
<p><a href="{{.ProxyPrefix}}/sign_in">Sign In</a></p>
<p>Powered by <a href="https://goauthentik.io">authentik</a></p>
2020-09-02 22:04:12 +00:00
</body>
</html>{{end}}`)
if err != nil {
2020-09-30 10:03:18 +00:00
log.Fatalf("failed parsing template %s", err)
2020-09-02 22:04:12 +00:00
}
return t
}