package templates // import "github.com/pomerium/pomerium/internal/templates" import ( "html/template" ) // New loads html and style resources directly. Panics on failure. func New() *template.Template { t := template.New("authenticate-templates") template.Must(t.Parse(` {{define "header.html"}} {{end}}`)) t = template.Must(t.Parse(`{{define "footer.html"}}Secured by pomerium {{end}}`)) t = template.Must(t.Parse(` {{define "sign_in_message.html"}} {{if eq (len .AllowedDomains) 1}} {{if eq (index .AllowedDomains 0) "@*"}}

You may sign in with any {{.ProviderName}} account.

{{else}}

You may sign in with your {{index .AllowedDomains 0}} {{.ProviderName}} account.

{{end}} {{else if gt (len .AllowedDomains) 1}}

You may sign in with any of these {{.ProviderName}} accounts:
{{range $i, $e := .AllowedDomains}}{{if $i}}, {{end}}{{$e}}{{end}}

{{end}} {{end}}`)) t = template.Must(t.Parse(` {{define "sign_in.html"}} Sign In {{template "header.html"}}

Sign in to {{.Destination}}

{{template "sign_in_message.html" .}}
{{end}}`)) template.Must(t.Parse(` {{define "error.html"}} Error {{template "header.html"}}

{{.Title}}

{{.Message}}
HTTP {{.Code}}

{{end}}`)) t = template.Must(t.Parse(` {{define "sign_out.html"}} Sign Out {{template "header.html"}}
{{ if .Message }}
{{.Message}}
{{ end}}

Sign out of {{.Destination}}

You're currently signed in as {{.Email}}. This will also sign you out of other internal apps.

{{end}}`)) return t }