Add delete functionality to canvas card with confirmation dialog

- Implemented delete action for canvas cards, including a confirmation dialog.
- Updated `canvas-card.tsx` to support renaming and deleting canvases.
- Enhanced documentation in `CLAUDE.md` to reflect new features and mutations.
- Added success and error toast messages for delete actions.
This commit is contained in:
Matthias
2026-04-01 12:09:01 +02:00
parent 0022b57c88
commit 34135d643e
6 changed files with 160 additions and 59 deletions

View File

@@ -116,6 +116,20 @@ optionalAuth(ctx) // → { userId: string } | null
Wirft bei unauthentifiziertem Zugriff. Wird von allen Queries und Mutations genutzt, die User-Daten berühren.
### Better-Auth Setup (`auth.ts`)
- Auth-Library läuft in Convex (`createAuth`) und wird via `authComponent.registerRoutes(http, createAuth)` in `http.ts` registriert.
- Login-Modi:
- `emailAndPassword` (mit `requireEmailVerification: true`)
- `magicLink` Plugin (`better-auth/plugins`)
- Magic-Link-Konfiguration:
- `disableSignUp: true` (Magic Link nur für bestehende Accounts)
- `expiresIn: 600` (10 Minuten)
- Versand über Resend (`sendMagicLink`)
- **Wichtig für Multi-Domain-Setup (`SITE_URL` + `APP_URL`)**:
- Verify-Links aus Better Auth werden vor dem Versand auf die App-Origin umgeschrieben (`toAuthAppUrl(...)`), damit Session-Cookies auf der korrekten Origin gesetzt werden.
- Ohne dieses Umschreiben kann Login per Magic Link zwar erfolgreich sein, aber das Dashboard in einem permanenten Loading-State hängen (fehlende Session auf App-Origin).
### Auth-Race-Härtung
- `canvases.get` nutzt optionalen Auth-Check und gibt bei fehlender Session `null` zurück (statt Throw), damit SSR/Client-Hydration bei kurzem Token-Race nicht in `404` kippt.