diff --git a/server/routes.go b/server/routes.go index c89272a..606036e 100644 --- a/server/routes.go +++ b/server/routes.go @@ -91,4 +91,10 @@ func addRoutes( middleware.RequiresLogin( handlers.HandleChangeBio(logger, conn), )) + mux.Handle("POST /change-password", + middleware.RequiresLogin( + middleware.RequiresFresh( + handlers.HandleChangePassword(logger, conn), + ), + )) } diff --git a/view/component/account/changepassword.templ b/view/component/account/changepassword.templ new file mode 100644 index 0000000..6c368d3 --- /dev/null +++ b/view/component/account/changepassword.templ @@ -0,0 +1,141 @@ +package account + +templ ChangePassword(err string) { +
+ +
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+
+

+
+} diff --git a/view/component/account/container.templ b/view/component/account/container.templ index f4350d7..f065949 100644 --- a/view/component/account/container.templ +++ b/view/component/account/container.templ @@ -19,7 +19,7 @@ templ AccountContainer(subpage string) { case "General": @AccountGeneral() case "Security": - @AccountGeneral() + @AccountSecurity() } diff --git a/view/component/account/security.templ b/view/component/account/security.templ new file mode 100644 index 0000000..e61ead8 --- /dev/null +++ b/view/component/account/security.templ @@ -0,0 +1,7 @@ +package account + +templ AccountSecurity() { +
+ @ChangePassword("") +
+} diff --git a/view/component/form/confirmpass.templ b/view/component/form/confirmpass.templ index 90bb192..a19e9a6 100644 --- a/view/component/form/confirmpass.templ +++ b/view/component/form/confirmpass.templ @@ -9,11 +9,11 @@ templ ConfirmPassword(err string) { x-on:htmx:xhr:loadstart="submitted=true;buttontext='Loading...'" >