feat(auth): change password user self service #171
All checks were successful
Build and Push Docker Image / Explore-Gitea-Actions (push) Successful in 58s

This commit is contained in:
2024-09-12 22:38:09 +02:00
parent ae75fce3ae
commit 6a656b15f0
4 changed files with 117 additions and 8 deletions

View File

@@ -0,0 +1,22 @@
package auth
templ ChangePasswordComp() {
<form
class="max-w-xl px-2 mx-auto flex flex-col gap-4 h-full justify-center"
hx-post="/api/auth/change-password"
hx-swap="none"
>
<h2 class="text-6xl mb-10">
Change Password
</h2>
<label class="input input-bordered flex items-center gap-2">
<input type="password" class="grow" placeholder="Current Password" name="current-password"/>
</label>
<label class="input input-bordered flex items-center gap-2">
<input type="password" class="grow" placeholder="New Password" name="new-password"/>
</label>
<button class="btn btn-primary self-end">
Change Password
</button>
</form>
}

View File

@@ -23,6 +23,9 @@ templ UserComp(user string) {
<li class="mb-1">
<a hx-get="/api/auth/signout" hx-target="#user-info">Sign Out</a>
</li>
<li class="mb-1">
<a href="/auth/change-password">Change Password</a>
</li>
<li><a href="/auth/delete-account" class="text-error">Delete Account</a></li>
</ul>
</div>