mirror of
https://github.com/bitbaum/evig.git
synced 2026-12-04 05:57:00 +01:00
* feat(auth): "Sign in with OrangeCat" beside the password login; connect from the profile
Step D8 of orangecat ADR-0009 ("One account for every door"). evig keeps its
own accounts — staff grants, orders and memberships live here — and lets an
account BE an OrangeCat account by carrying the actor id.
- /auth/login: "Mit OrangeCat anmelden" beside the password form, shown only
when Auth.js actually mounted the provider (the form asks /api/auth/providers),
so the button can never be a dead end.
- users.orangecat_actor_id (migration 141, unique): the ONLY cross-product
key. Never email — OrangeCat's password sign-up does not verify the address,
so an email match would let anyone who registers the victim's address there
walk in here. src/lib/auth/orangecat.ts holds the rules, pure and tested:
a linked actor signs in; a new person gets an account (email unverified,
like a fresh password registration); an existing unlinked account with that
email is refused with a message that names the way forward.
- That way forward: "OrangeCat verbinden" on the profile. POST /api/user/orangecat
mints a signed ten-minute cookie for the signed-in user; the sign-in callback
reads it and attaches the OrangeCat identity to THAT account and no other.
- Staff is untouched: is_staff stays the sole grant, whatever the sign-in.
Provider config mirrors Solon/Heidi/Loki (client_secret_post, PKCE + state,
openid profile email). Env pair documented in .env.example; the client is
registered on the OrangeCat box with scripts/oauth/register-client.ts.
Verified: the pure module typechecks and its 10 tests pass; prettier and
lint:umlauts clean. A full tsc/lint run was not possible in the sandbox (the
ai-forms GitHub tarball is blocked there); CI is the gate.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDMxjTqKNLXETMYYuapMa3
* fix(auth): typecheck and docs-path check for the OrangeCat sign-in
- OrangeCatSection: apiFetch may resolve undefined; fall back to the
hidden state instead of passing undefined to setState (CI tsc).
- CLAUDE.md: name orangecat's ADR-0009 without a path the docs-paths
checker reads as local.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDMxjTqKNLXETMYYuapMa3
* fix(auth): OrangeCat section reads the apiFetch envelope; strings in every locale
- apiFetch resolves { success, data?, error? }; the section typed the payload
as the envelope (CI tsc). Read data on success, treat a refused link intent
as an error instead of starting the round-trip anyway.
- The nine new strings translated into fr, it, es, ru, ja, ko so the i18n
audit's baseline stays where it is.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDMxjTqKNLXETMYYuapMa3
---------
Co-authored-by: Claude <noreply@anthropic.com>