tag claim flow: scanned code auto-fills Add Tag field (?code=), unclaimed tag page shows 'Add this tag to my account' when logged in, login honors next= so code survives the login step

This commit is contained in:
2026-08-10 17:04:21 +10:00
parent 04fd5ac63a
commit 1fae314eb4
5 changed files with 24 additions and 7 deletions

View File

@@ -4,7 +4,7 @@
<div class="mt-4 rounded-xl border border-stone-200 bg-white p-4 shadow-sm">
<form hx-post="/account/tags" hx-target="#account-panel" hx-swap="outerHTML" class="flex gap-2">
<input name="tag_code" type="text" placeholder="Enter tag code (e.g. TEST000001)" class="flex-1 rounded border border-stone-300 px-3 py-2 text-sm" required>
<input name="tag_code" type="text" value="{{.AddTagCode}}" placeholder="Enter tag code (e.g. TEST000001)" class="flex-1 rounded border border-stone-300 px-3 py-2 text-sm" required autofocus>
<button type="submit" class="rounded bg-stone-900 px-4 py-2 text-sm font-semibold text-white hover:bg-stone-700">Add tag</button>
<span class="htmx-indicator self-center text-xs text-stone-400">Adding…</span>
</form>