Multi-tenancy : espaces de travail + fix auth reload (rate limiter OPTIONS)

- Modèles Organization + OrgMember, migration Alembic (SQLite compatible)
- organization_id nullable sur Document, Decision, Mandate, VotingProtocol
- Service, schéma, router /organizations + dependency get_active_org_id
- Seed : Duniter G1 + Axiom Team ; tout le contenu seed attaché à Duniter G1
- Backend : list/create filtrés par header X-Organization
- Frontend : store organizations, WorkspaceSelector réel, useApi injecte l'org
- Fix critique : rate_limiter exclut les requêtes OPTIONS (CORS preflight)
  → résout le bug "Failed to fetch /auth/me" au reload (429 sur preflight)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Yvv
2026-04-23 15:17:14 +02:00
parent 224e5b0f5e
commit 79e468b40f
31 changed files with 1296 additions and 159 deletions

View File

@@ -116,6 +116,22 @@ function formatDate(dateStr: string): string {
</p>
</div>
<!-- Décider CTA -->
<NuxtLink to="/decisions/new" class="dash__decide">
<div class="dash__decide-left">
<div class="dash__decide-icon">
<UIcon name="i-lucide-scale" class="text-xl" />
</div>
<div class="dash__decide-text">
<span class="dash__decide-label">Prendre une décision</span>
<span class="dash__decide-sub">Individuelle · collective · déléguée le parcours s'adapte</span>
</div>
</div>
<div class="dash__decide-arrow">
<UIcon name="i-lucide-arrow-right" class="text-base" />
</div>
</NuxtLink>
<!-- Entry cards -->
<div class="dash__entries">
<template v-if="loading">
@@ -177,7 +193,7 @@ function formatDate(dateStr: string): string {
<span class="dash__toolbox-card-tag">Vote WoT</span>
<span class="dash__toolbox-card-tag">Inertie</span>
<span class="dash__toolbox-card-tag">Smith</span>
<span class="dash__toolbox-card-tag">Nuancé</span>
<span class="dash__toolbox-card-tag">Élection</span>
</div>
</div>
<UIcon name="i-lucide-arrow-right" class="dash__toolbox-card-arrow" />
@@ -292,6 +308,87 @@ function formatDate(dateStr: string): string {
}
}
/* --- Décider CTA --- */
.dash__decide {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
padding: 1.25rem;
background: var(--mood-accent);
border-radius: 16px;
text-decoration: none;
transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.dash__decide:hover {
transform: translateY(-2px);
box-shadow: 0 8px 28px var(--mood-shadow);
}
.dash__decide:active { transform: translateY(0); }
.dash__decide-left {
display: flex;
align-items: center;
gap: 0.875rem;
min-width: 0;
}
.dash__decide-icon {
width: 2.75rem;
height: 2.75rem;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
border-radius: 14px;
background: rgba(255,255,255,0.18);
color: var(--mood-accent-text);
}
.dash__decide-text {
display: flex;
flex-direction: column;
gap: 0.125rem;
min-width: 0;
}
.dash__decide-label {
font-size: 1rem;
font-weight: 800;
color: var(--mood-accent-text);
letter-spacing: -0.01em;
}
@media (min-width: 640px) {
.dash__decide-label { font-size: 1.125rem; }
}
.dash__decide-sub {
font-size: 0.75rem;
color: rgba(255,255,255,0.75);
font-weight: 500;
}
@media (min-width: 640px) {
.dash__decide-sub { font-size: 0.8125rem; }
}
.dash__decide-arrow {
flex-shrink: 0;
width: 2rem;
height: 2rem;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background: rgba(255,255,255,0.18);
color: var(--mood-accent-text);
transition: transform 0.12s;
}
.dash__decide:hover .dash__decide-arrow {
transform: translateX(3px);
}
/* --- Entry cards --- */
.dash__entries {
display: grid;