Files
verdande/web
kristianwindandClaude Opus 5.5 e7df876c4a feat(mcp): forbind med kontoen i stedet for med et token
Claude's forbindelsesdialog prøver OAuth først. Indtil nu var svaret 404,
og eneste vej ind var at lave et token og sætte det ind i en adresse. Nu
er instansen sin egen autorisationsserver for MCP-klienter:

- /.well-known/oauth-protected-resource(/mcp) og
  /.well-known/oauth-authorization-server peger på login'et; en 401 fra
  /mcp bærer WWW-Authenticate med resource_metadata
- /oauth/register (RFC 7591), kun offentlige klienter; registreringer,
  ingen godkender, ryddes efter et døgn
- /oauth/authorize sender til /forbind, som logger ind med det almindelige
  login og spørger "Claude vil forbinde til din konto" — og viser, hvor
  adgangen sendes hen, fordi navnet er klientens eget
- /oauth/token: authorization code + S256 PKCE, koden gælder ét minut og
  én gang; ud kommer et almindeligt API-token, listet under Tokens med
  klientens navn, og en ny forbindelse fra samme klient erstatter det
- /mcp tager nu også Authorization: Bearer; ?key= virker stadig

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 22:49:48 +01:00
..

web

The SvelteKit PWA. Not written yet — this directory holds its place so the Docker build has something to copy, and so the frontend stage can tell "not built yet" apart from "the build failed".

The Dockerfile builds this directory when it finds a package.json here, and otherwise emits a placeholder page. So adding the real app is exactly: put a SvelteKit project in this directory whose npm run build produces build/.

What it needs to be

  • SvelteKit, adapter-static, output in build/. The Go binary embeds that directory at compile time and serves it, falling back to index.html so client-side routes survive a reload.
  • A PWA: installable, offline reading of already-cached lists, swipe gestures for complete and schedule.
  • Nordic minimalism. Dark by default, light available. One accent colour, everything else neutral. Runic mark for Verdande.
  • Optimistic on every local action. No spinner ever appears for something the browser could already know the answer to.

Talking to the backend

Same origin — the Go binary serves both. /api/v1 for REST, /api/v1/ws for the live sync. Session cookie is httpOnly, so the frontend never handles the token itself.

During development, run the backend on 8080 and point the Vite dev server's proxy at it:

VERDANDE_DATA_DIR=./data VERDANDE_DEV=true go run ./cmd/verdande