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" }} -
- Welcome {{ .User.User }}! - Logout -
-
-

{{ if .User.Admin }} @@ -29,11 +25,11 @@ {{ end }}

- Change Password + Change Password {{ if .User.TOTPEnabled }} - Disable TOTP + Disable TOTP {{ else }} - Enable TOTP + Enable TOTP {{ end }}

@@ -43,11 +39,13 @@
{{ if (not .User.TOTPEnabled) }}
- TOTP is required to access these. +

+ TOTP is required to access these. +

{{ end }}
diff --git a/internal/dis/component/auth/templates/password.html b/internal/dis/component/auth/templates/password.html index 3d6342b..228e897 100644 --- a/internal/dis/component/auth/templates/password.html +++ b/internal/dis/component/auth/templates/password.html @@ -1,9 +1,13 @@ {{ template "_form.html" . }} {{ define "form/title" }}Change Password{{ end }} {{ define "form/button" }}Update{{ end }} -{{ define "form/extra" }} -
- Back -
-
+ +{{ define "header"}} +

+ {{ .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" }} -
- Back -
-
+ +{{ define "header"}} +

+ {{ .User.User }} > + Disable TOTP +

+

+ Logout +

{{ end }} + {{ define "form/inside" }}