about summary refs log tree commit diff
path: root/nix/templates/goapp/frontend/src/templates.go
diff options
context:
space:
mode:
authorEmile <git@emile.space>2025-02-19 19:53:25 +0100
committerEmile <git@emile.space>2025-02-19 19:53:25 +0100
commitae39f02812bcfe903e956220c890bfb7b9bb9ff4 (patch)
treedff7028627665a7d2cb7cd64533ac74ec8919379 /nix/templates/goapp/frontend/src/templates.go
parent07425c679f7399284c0fe3dcbee54f45b23d07a0 (diff)
removed the backend, added the frontend with oidc support
So I've added oidc support which is nice, yet I have to test this
with some https foo, so I'm pushing this.
Diffstat (limited to 'nix/templates/goapp/frontend/src/templates.go')
-rw-r--r--nix/templates/goapp/frontend/src/templates.go42
1 files changed, 42 insertions, 0 deletions
diff --git a/nix/templates/goapp/frontend/src/templates.go b/nix/templates/goapp/frontend/src/templates.go
new file mode 100644
index 0000000..5ae9397
--- /dev/null
+++ b/nix/templates/goapp/frontend/src/templates.go
@@ -0,0 +1,42 @@
+package main
+
+import (
+	"html/template"
+	"strings"
+)
+
+var (
+	templateFuncMap = template.FuncMap{
+		"stringsJoin":      strings.Join,
+		"stringsEqualFold": strings.EqualFold,
+		"isStringInSlice":  isStringInSlice,
+	}
+)
+
+type indexTplData struct {
+	Title, Description, RawToken string
+
+	Breadcrumbs []Breadcrumb
+	NextLinks   []Link
+
+	Error            string
+	LoggedIn         bool
+	Claims           tplClaims
+	Groups           []string
+	AuthorizeCodeURL string
+}
+
+type Link struct {
+	Name   string
+	Target string
+}
+
+type Breadcrumb struct {
+	Main    Link
+	Options []Link
+}
+
+type tplClaims struct {
+	IDToken  Claims
+	UserInfo Claims
+}