diff --git a/internal/cli/cli_notices.go b/internal/cli/cli_notices.go index 2e4c543..8b0fba2 100755 --- a/internal/cli/cli_notices.go +++ b/internal/cli/cli_notices.go @@ -1,7 +1,7 @@ package cli // =========================================================================================================== -// This file was generated automatically at 02-01-2023 12:34:04 using gogenlicense. +// This file was generated automatically at 03-01-2023 11:39:55 using gogenlicense. // Do not edit manually, as changes may be overwritten. // =========================================================================================================== @@ -2133,7 +2133,7 @@ package cli // # Generation // // This variable and the associated documentation have been automatically generated using the 'gogenlicense' tool. -// It was last updated at 02-01-2023 12:34:04. +// It was last updated at 03-01-2023 11:39:55. var LegalNotices string func init() { diff --git a/internal/dis/component/auth/auth.go b/internal/dis/component/auth/auth.go index 5f10383..0a7315c 100644 --- a/internal/dis/component/auth/auth.go +++ b/internal/dis/component/auth/auth.go @@ -27,7 +27,7 @@ var ( _ component.Routeable = (*Auth)(nil) ) -func (auth *Auth) Routes() []string { return []string{"/auth/"} } +func (auth *Auth) Routes() []string { return []string{"/user/"} } func (auth *Auth) HandleRoute(ctx context.Context, route string) (http.Handler, error) { router := httprouter.New() diff --git a/internal/dis/component/auth/protect.go b/internal/dis/component/auth/protect.go index 12d20f2..104ec44 100644 --- a/internal/dis/component/auth/protect.go +++ b/internal/dis/component/auth/protect.go @@ -33,7 +33,7 @@ func (auth *Auth) Protect(handler http.Handler, perm Permission) http.Handler { } // redirect the user to the login endpoint, with the original URI as a return - dest := "/auth/login?next=" + url.QueryEscape(r.URL.RequestURI()) + dest := "/user/login?next=" + url.QueryEscape(r.URL.RequestURI()) http.Redirect(w, r, dest, http.StatusSeeOther) return } diff --git a/internal/dis/component/auth/routes.go b/internal/dis/component/auth/routes.go index 1b7e286..3410e35 100644 --- a/internal/dis/component/auth/routes.go +++ b/internal/dis/component/auth/routes.go @@ -49,7 +49,8 @@ func (auth *Auth) authPassword(ctx context.Context) http.Handler { CSRF: auth.csrf.Get(nil), - RenderTemplate: passwordTemplate, + RenderTemplate: passwordTemplate, + RenderTemplateContext: auth.UserFormContext, Validate: func(r *http.Request, values map[string]string) (struct{}, error) { old, passcode, new, new2 := values["old"], values["passcode"], values["new"], values["new2"] diff --git a/internal/dis/component/auth/templates/home.html b/internal/dis/component/auth/templates/home.html index 4039a85..b85b662 100644 --- a/internal/dis/component/auth/templates/home.html +++ b/internal/dis/component/auth/templates/home.html @@ -1,20 +1,16 @@ {{ template "_base.html" . }} -{{ define "title" }}Distillery User{{ end }} +{{ define "title" }}User{{ end }} -{{ define "header/time" }} - -{{ end }} {{ define "header"}} - +
+ {{ .User.User }} +
++ Logout +
{{ end }} {{ define "content" }} -{{ if .User.Admin }} @@ -29,11 +25,11 @@ {{ end }}
+ {{ .User.User }} > + Change Password +
++ Logout +
{{ end }} diff --git a/internal/dis/component/auth/templates/totp_disable.html b/internal/dis/component/auth/templates/totp_disable.html index 080cac9..7fc4399 100644 --- a/internal/dis/component/auth/templates/totp_disable.html +++ b/internal/dis/component/auth/templates/totp_disable.html @@ -1,12 +1,17 @@ {{ template "_form.html" . }} {{ define "form/title" }}Disable TOTP{{ end }} {{ define "form/button" }}Disable{{ end }} -{{ define "form/extra" }} -+ {{ .User.User }} > + Disable TOTP +
++ Logout +
{{ end }} + {{ define "form/inside" }}+ {{ .User.User }} > + Enable TOTP +
++ Logout +
{{ end }} {{ define "form/inside" }}+ {{ .User.User }} > + Enroll TOTP +
++ Logout +
{{ end }} {{ define "form/inside" }}- Control > - Components + Admin > + Components
{{ end }} diff --git a/internal/dis/component/control/info/html/index.html b/internal/dis/component/control/info/html/index.html index cf1137b..4909062 100644 --- a/internal/dis/component/control/info/html/index.html +++ b/internal/dis/component/control/info/html/index.html @@ -1,12 +1,12 @@ {{ template "_base.html" . }} -{{ define "title" }}Distillery Control Page{{ end }} +{{ define "title" }}Distillery Admin{{ end }} {{ define "header"}}- Components + Components
{{ end }} @@ -269,7 +269,7 @@- Control > - Instance > - Ingredients + Admin > + Instance > + Ingredients
{{ end }} diff --git a/internal/dis/component/control/info/html/instance.html b/internal/dis/component/control/info/html/instance.html index 74862ab..4fed81f 100644 --- a/internal/dis/component/control/info/html/instance.html +++ b/internal/dis/component/control/info/html/instance.html @@ -1,13 +1,13 @@ {{ template "_base.html" . }} -{{ define "title" }}Distillery Control Page - {{ .Info.Slug }}{{ end }} +{{ define "title" }}Distillery Admin - {{ .Info.Slug }}{{ end }} {{ define "header"}}- Control > - Instance + Control > + Instance
{{ end }} @@ -247,7 +247,7 @@{{ $user.Login.Time.Format "2006-01-02T15:04:05Z07:00" }}