From f881e1c13ca0cdcdff09c99a2af213163f8bd713 Mon Sep 17 00:00:00 2001 From: Thomas Miceli <27960254+thomiceli@users.noreply.github.com> Date: Tue, 3 Sep 2024 17:48:45 +0200 Subject: [PATCH] Hide change password form when login via password disabled (#314) --- internal/web/settings.go | 1 + templates/pages/settings.html | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/web/settings.go b/internal/web/settings.go index d3d814b..02a0261 100644 --- a/internal/web/settings.go +++ b/internal/web/settings.go @@ -29,6 +29,7 @@ func userSettings(ctx echo.Context) error { setData(ctx, "email", user.Email) setData(ctx, "sshKeys", keys) setData(ctx, "hasPassword", user.Password != "") + setData(ctx, "disableForm", getData(ctx, "DisableLoginForm")) setData(ctx, "htmlTitle", trH(ctx, "settings")) return html(ctx, "settings.html") } diff --git a/templates/pages/settings.html b/templates/pages/settings.html index 98d41e4..45b4078 100644 --- a/templates/pages/settings.html +++ b/templates/pages/settings.html @@ -7,7 +7,7 @@
-
+

@@ -28,6 +28,7 @@

+ {{ if not .disableForm }}

@@ -64,6 +65,7 @@

+ {{ end }}