Add password-visibility toggle to login page (TypeScript)

- web/ts/login.ts: small vanilla TS module toggling the password input's
  type between 'password'/'text' via a 'Show/Hide' button, so users can
  rule out typos before submitting. Compiled to web/static/login.js
  (ES module) via tsc (web/tsconfig.json, new 'make web-ts'/'web-assets'
  Makefile targets) and loaded via <script type="module">. Compiled JS
  is committed/embedded the same way as the compiled CSS — no Node.js
  needed at runtime.
- Verified end-to-end against the live proxied server
  (https://local.unqr.dev/web/login): POST /web/login correctly returns
  303 + Set-Cookie, and the session then authorizes GET /web/ — the
  server-side login flow is confirmed working correctly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-08-19 10:13:37 +02:00
co-authored by Copilot
parent 4dba55c807
commit 3dc49b6b22
11 changed files with 469 additions and 19 deletions
+10 -2
View File
@@ -1,4 +1,4 @@
.PHONY: build run test tidy lint docker hash-password nidusctl web-deps web-css templ-generate
.PHONY: build run test tidy lint docker hash-password nidusctl web-deps web-css web-ts web-assets templ-generate
## build: compile the binary
build:
@@ -43,7 +43,7 @@ nidusctl: build
templ-generate:
templ generate
## web-deps: install the Tailwind CLI (needed once, or after web/package.json changes)
## web-deps: install the Tailwind CLI + TypeScript compiler (needed once, or after web/package.json changes)
web-deps:
cd web && npm install
@@ -51,3 +51,11 @@ web-deps:
## Run this after editing any .templ file or web/input.css.
web-css: templ-generate
cd web && npx @tailwindcss/cli -i ./input.css -o ./static/app.css --minify
## web-ts: compile web/ts/*.ts to web/static/*.js
## Run this after editing any .ts file.
web-ts:
cd web && npx tsc -p tsconfig.json
## web-assets: rebuild everything under web/static/ (CSS + JS)
web-assets: web-css web-ts