diff --git a/internal/handlers/device-enrolled.go b/internal/handlers/device-enrolled.go index d8740dd49..e0fbf4b97 100644 --- a/internal/handlers/device-enrolled.go +++ b/internal/handlers/device-enrolled.go @@ -10,6 +10,6 @@ import ( // DeviceEnrolled displays an HTML page informing the user that they've successfully enrolled a device. func DeviceEnrolled(data UserInfoData) http.Handler { return httputil.HandlerFunc(func(w http.ResponseWriter, r *http.Request) error { - return ui.ServePage(w, r, "DeviceEnrolled", data.ToJSON()) + return ui.ServePage(w, r, "DeviceEnrolled", "Device Enrolled", data.ToJSON()) }) } diff --git a/internal/handlers/signedout.go b/internal/handlers/signedout.go index 5fd0440ca..0914220e8 100644 --- a/internal/handlers/signedout.go +++ b/internal/handlers/signedout.go @@ -24,6 +24,6 @@ func SignedOut(data SignedOutData) http.Handler { } // otherwise show the signed-out page - return ui.ServePage(w, r, "SignedOut", data.ToJSON()) + return ui.ServePage(w, r, "SignedOut", "Signed Out", data.ToJSON()) }) } diff --git a/internal/handlers/signout.go b/internal/handlers/signout.go index db2b0aac3..dfe37735b 100644 --- a/internal/handlers/signout.go +++ b/internal/handlers/signout.go @@ -22,6 +22,6 @@ func (data SignOutConfirmData) ToJSON() map[string]interface{} { // SignOutConfirm returns a handler that renders the sign out confirm page. func SignOutConfirm(data SignOutConfirmData) http.Handler { return httputil.HandlerFunc(func(w http.ResponseWriter, r *http.Request) error { - return ui.ServePage(w, r, "SignOutConfirm", data.ToJSON()) + return ui.ServePage(w, r, "SignOutConfirm", "Confirm Sign Out", data.ToJSON()) }) } diff --git a/internal/handlers/userinfo.go b/internal/handlers/userinfo.go index ea3737d1a..c430d4f85 100644 --- a/internal/handlers/userinfo.go +++ b/internal/handlers/userinfo.go @@ -65,6 +65,6 @@ func (data UserInfoData) ToJSON() map[string]any { // UserInfo returns a handler that renders the user info page. func UserInfo(data UserInfoData) http.Handler { return httputil.HandlerFunc(func(w http.ResponseWriter, r *http.Request) error { - return ui.ServePage(w, r, "UserInfo", data.ToJSON()) + return ui.ServePage(w, r, "UserInfo", "User Info Dashboard", data.ToJSON()) }) } diff --git a/internal/handlers/webauthn/webauthn.go b/internal/handlers/webauthn/webauthn.go index 45e0f95a5..468556c2f 100644 --- a/internal/handlers/webauthn/webauthn.go +++ b/internal/handlers/webauthn/webauthn.go @@ -402,7 +402,7 @@ func (h *Handler) handleView(w http.ResponseWriter, r *http.Request, state *Stat "selfUrl": r.URL.String(), } httputil.AddBrandingOptionsToMap(m, state.BrandingOptions) - return ui.ServePage(w, r, "WebAuthnRegistration", m) + return ui.ServePage(w, r, "WebAuthnRegistration", "Device Registration", m) } func (h *Handler) saveSessionAndRedirect(w http.ResponseWriter, r *http.Request, state *State, rawRedirectURI string) error { diff --git a/internal/httputil/errors.go b/internal/httputil/errors.go index 35e6d01d9..e38b1ea05 100644 --- a/internal/httputil/errors.go +++ b/internal/httputil/errors.go @@ -2,6 +2,7 @@ package httputil import ( "context" + "fmt" "net/http" "net/url" @@ -101,7 +102,7 @@ func (e *HTTPError) ErrorResponse(ctx context.Context, w http.ResponseWriter, r w.Header().Set("Content-Type", "text/html; charset=UTF-8") w.WriteHeader(response.Status) - if err := ui.ServePage(w, r, "Error", m); err != nil { + if err := ui.ServePage(w, r, "Error", fmt.Sprintf("%d %s", response.Status, response.StatusText), m); err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) } } diff --git a/ui/dist/index.html b/ui/dist/index.gohtml similarity index 92% rename from ui/dist/index.html rename to ui/dist/index.gohtml index 16fa094c6..ffbefdf10 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.gohtml @@ -25,14 +25,14 @@ name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> -