Added basic login functionality to login form

This commit is contained in:
2025-02-08 15:29:17 +11:00
parent 5a93ef81dd
commit 1004dc9563
9 changed files with 138 additions and 7 deletions

View File

@@ -5,14 +5,14 @@ import "fmt"
templ LoginForm(loginError string) {
{{
var errCreds string
if loginError == "Username or password is incorrect" {
if loginError == "Username or password incorrect" {
errCreds = "true"
} else {
errCreds = "false"
}
xdata := fmt.Sprintf("{credentialError: %s, errorMessage: '%s'}", errCreds, loginError)
}}
<form>
<form hx-post="/login">
<div
class="grid gap-y-4"
x-data={ xdata }
@@ -26,7 +26,7 @@ templ LoginForm(loginError string) {
<div class="relative">
<input
type="text"
id="username"
idnutanix="username"
name="username"
class="py-3 px-4 block w-full rounded-lg text-sm
focus:border-blue focus:ring-blue bg-base
@@ -65,6 +65,7 @@ templ LoginForm(loginError string) {
text-blue decoration-2 hover:underline
focus:outline-none focus:underline font-medium"
href="/recover-account"
tabindex="-1"
>Forgot password?</a>
</div>
<div class="relative">