Commit Graph
13 Commits
Author SHA1 Message Date
SluijsensandClaude Sonnet 5.5 149f81a479 U2 identity-mail-flows (backend): taal per gebruiker, uitnodigingsmail, opnieuw versturen, meldingen, stamp-controle
Kolommen Users.PreferredLanguage en Invitations.Language (additieve migratie). IdentityMailService
verstuurt uitnodiging, nieuwe link en meldingen bij deactiveren, heractiveren en rolwijziging;
een mailfout laat nooit een actie falen, het resultaat gaat mee in de respons naast de
kopieerbare link. Nieuwe actie resend-invite. De security stamp zit in het access token en wordt
vergeleken in de actief-controle: een wachtwoordwijziging beeindigt eerder uitgegeven access tokens,
de refresh geeft stil een nieuw token.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 19:10:44 +01:00
SluijsensandClaude Sonnet 5.5 026a12a3f1 Gebruikersbeheer: rolhierarchie in de API afdwingen en uitnodiging opnieuw aanmaken
Een Beheerder mag alleen gebruikers met rol User verwijderen, deactiveren, van rol wisselen
of hun uitnodiging intrekken, en kent nooit de Owner-rol toe. De regels staan op een plek
(UserManagementRules) en worden in de API afgedwongen. Nieuwe actie om een openstaande of
verlopen uitnodiging een nieuwe link te geven (oude link vervalt).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 15:59:10 +01:00
SluijsensandClaude Sonnet 5.5 ed7a172f44 Uitnodigingen: geldigheid instelbaar (standaard 24 uur) en verlopen uitnodigingen zichtbaar en verwijderbaar
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 15:49:32 +01:00
SluijsensandClaude Sonnet 5.5 3535d14987 Uitnodigingen: naam opslaan en hetzelfde e-mailadres opnieuw kunnen uitnodigen
De naam uit het uitnodigingsformulier werd niet opgeslagen (profiel en verwijder-dialoog
toonden het e-mailadres). Een geaccepteerde uitnodiging bleef na het verwijderen van de
gebruiker staan en blokkeerde het adres; het conflict gaf een 500. Nu 409 met een
specifieke melding en opruimen van verouderde uitnodigingen.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 14:36:09 +01:00
SluijsensandClaude Sonnet 5.5 33a7500648 Beveiliging: gedeactiveerde of verwijderde gebruiker wordt direct geweigerd
Het JWT werd alleen op handtekening en looptijd gecontroleerd, dus een gedeactiveerde
gebruiker kon tot het verlopen van het token lezen en schrijven. Nu controleert de
bearer-validatie per request of het account bestaat en actief is, en weigert de refresh
een inactieve gebruiker.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 14:36:09 +01:00
SluijsensandClaude Opus 5 8e79a72340 Makes the application say what it is doing and when it fails
U4. Console logging plus Sentry, a same-origin tunnel so ad blockers cannot
silence browser errors, Umami on the admin SPA, and six security events that
alert rules can actually be built on.

The correlation id is the W3C trace id from the ambient Activity, enabled by
one line of ActivityTrackingOptions so every entry from every category carries
it without touching a call site. It propagates across the master/slave
boundary via traceparent, which TraceIdentifier cannot do at all, and it is
the same value ProblemDetails already returns to the browser.

The security events use source-generated LoggerMessage with constant
templates. Sentry groups log events by message, so interpolating an email
address would give every address its own issue and "more than 20 failed
logins in five minutes" could never fire — the events would arrive, be
visible, be tagged, and the alerting would silently be impossible. A test
asserts the rendered message is identical across argument values.

Scrubbing happens in-process, before transmission, and covers Set-Cookie as
well as Cookie: the login response issues the refreshToken there, so
scrubbing only the request side would protect nothing. Transactions are
scrubbed too, because they carry request data and are the channel nobody
thinks of.

The tunnel derives its destination from the DSN once at startup and reads
nothing from the request, which is what separates a tunnel from a
server-side request forgery primitive. Size is capped by a bounded read
rather than by trusting Content-Length, and the endpoint is rate limited.

Two things found along the way. Zod 4's url() hands the value to the URL
constructor, which accepts any scheme — so the existing frontend validation
would have accepted the exact "htp://" typo BR-U4-24 names, and the SPA
would have called a nonexistent origin. Now constrained to http(s). And the
new appsettings comments are verified against the real configuration
provider, because the failure mode if it rejected them is both hosts
refusing to start after a release switch.

One deviation. IAdminTokenValidator was meant to gain a reason-reporting
overload; implemented that way, a substitute returning false by default
silently inverted the access decision while both methods compiled. Two
methods whose difference is invisible at the call site is the defect, so it
is now a single Validate returning AdminTokenResult.

Touches two files from already-committed units: DatabaseMigrationExtensions
(U2) gains a flush before the rethrow, or the one Critical event in the
system dies with the process; AdminTokenValidator (U1) classifies why a
bypass was refused.

Build 0 errors; 366 backend tests pass, up from 315, and 237 frontend tests,
up from 213. tsc clean, eslint clean on every changed file.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HHoJpxYXzHACSQguHrC5fw
2026-07-28 11:25:54 +02:00
Sluijsens 0e01ca1e1c adds unit tests to cover 80% 2026-06-26 00:27:27 +02:00
Sluijsens 2544e20b3c Adds profile and settings pages 2026-06-22 23:59:04 +02:00
Sluijsens 6976eb4337 Adds user management 2026-06-22 21:14:22 +02:00
SluijsensandClaude Haiku 4.5 5331be4279 fix(auth): configurable SameSite cookie for cross-origin dev setup
Chrome 89+ schemeful same-site treats http://localhost and https://localhost
as different sites, blocking SameSite=Strict cookies on cross-origin fetch
(e.g. Vite on port 5173, API on port 7221).

Fix: make CookieSameSite configurable per environment in JwtSettings.
- Default: Strict (production)
- appsettings.Development.json: None (allows cross-origin cookie in dev)
- When SameSite=None, Secure is always forced (browser requirement)

Revert the earlier Vite proxy approach in favour of this backend config.
VITE_API_BASE_URL remains a freely configurable URL in .env.local.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-22 15:42:56 +02:00
SluijsensandClaude Haiku 4.5 f221d7cee5 fix(unit-2-auth): Redirect to /setup on API failure; store owner display name
- Router catch block now falls back to { initialized: false } instead of
  silently continuing, preventing unwanted redirect to /login when the
  API call fails at startup
- Add Name field to CreateOwnerRequest and propagate to ApplicationUser.DisplayName
  so the owner's display name is stored during initial setup

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-22 11:06:34 +02:00
Sluijsens 23e2150140 Changes backend in preparation for frontend work 2026-06-19 12:15:08 +02:00
Sluijsens 95d986790e Initial commit with inital CMS 2026-06-15 17:00:16 +02:00