Stack of changes to get gin, scs, nosurf running.

This commit is contained in:
2025-10-28 11:56:42 +00:00
parent 07117ba35e
commit 86be6479f1
65 changed files with 1890 additions and 1503 deletions

View File

@@ -1,9 +1,43 @@
{{ define "content" }}
<h2>Sign Up</h2>
<form method="POST" action="/account/signup">
{{ .csrfField }}
<label>Username: <input type="text" name="username" required></label><br>
<label>Password: <input type="password" name="password" required></label><br>
<button type="submit">Sign Up</button>
<h2>Create your account</h2>
{{ if .Flash }}<div class="flash">{{ .Flash }}</div>{{ end }}
<form method="POST" action="/account/signup" class="form">
<input type="hidden" name="csrf_token" value="{{ .CSRFToken }}">
<div class="mb-3">
<label for="username">Username</label>
<input type="text" name="username" id="username" required class="form-control"
value="{{ with .Form }}{{ .Username }}{{ end }}">
{{ with .Errors }}{{ with index . "username" }}<div class="error">{{ . }}</div>{{ end }}{{ end }}
</div>
<div class="mb-3">
<label for="email">Email</label>
<input type="email" name="email" id="email" required class="form-control"
value="{{ with .Form }}{{ .Email }}{{ end }}">
{{ with .Errors }}{{ with index . "email" }}<div class="error">{{ . }}</div>{{ end }}{{ end }}
</div>
<div class="mb-3">
<label for="password">Password</label>
<input type="password" name="password" id="password" required class="form-control">
{{ with .Errors }}{{ with index . "password" }}<div class="error">{{ . }}</div>{{ end }}{{ end }}
</div>
<div class="mb-3">
<label for="password_confirm">Confirm Password</label>
<input type="password" name="password_confirm" id="password_confirm" required class="form-control">
{{ with .Errors }}{{ with index . "password_confirm" }}<div class="error">{{ . }}</div>{{ end }}{{ end }}
</div>
<div class="form-check mb-3">
<input type="checkbox" name="accept_terms" id="accept_terms" class="form-check-input"
{{ with .Form }}{{ if .AcceptTerms }}checked{{ end }}{{ end }}>
<label for="accept_terms" class="form-check-label">I accept the terms</label>
{{ with .Errors }}{{ with index . "accept_terms" }}<div class="error">{{ . }}</div>{{ end }}{{ end }}
</div>
<button type="submit" class="btn btn-primary">Create account</button>
</form>
{{ end }}
{{ end }}