feat(auth): login JWT en API y las 4 apps
- Modelo Usuario + seed desde lista de vendedores (18 usuarios, bcrypt cost 12) - POST /api/auth/login + /api/auth/me; middleware Bearer en todo /api excepto health, login y webhook Monday; flag AUTH_ENABLED - Username = nombre completo normalizado (case/acentos insensible), password inicial Frasa2026, admin vía ADMIN_PASSWORD - Apps: LoginScreen + AuthGate (StudioBlank), token en localStorage, header Authorization en todas las llamadas, logout en 401 - Tests: api 136, cotizador 71, alta 65, cobranza 71, agente-ia 13, landing 4
This commit is contained in:
@@ -7,6 +7,7 @@ import '@fontsource/inter/500.css'
|
||||
import '@fontsource/inter/700.css'
|
||||
import './index.css'
|
||||
import Layout from './components/Layout'
|
||||
import AuthGate from './components/AuthGate'
|
||||
import DashboardPage from './pages/DashboardPage'
|
||||
import HoyPage from './pages/HoyPage'
|
||||
import PlanDetallePage from './pages/PlanDetallePage'
|
||||
@@ -15,15 +16,17 @@ import NuevoPlanPage from './pages/NuevoPlanPage'
|
||||
createRoot(document.getElementById('root')!).render(
|
||||
<StrictMode>
|
||||
<BrowserRouter basename="/pay">
|
||||
<Layout>
|
||||
<Routes>
|
||||
<Route path="/" element={<DashboardPage />} />
|
||||
<Route path="/hoy" element={<HoyPage />} />
|
||||
<Route path="/planes/:id" element={<PlanDetallePage />} />
|
||||
<Route path="/nuevo" element={<NuevoPlanPage />} />
|
||||
<Route path="*" element={<DashboardPage />} />
|
||||
</Routes>
|
||||
</Layout>
|
||||
<AuthGate>
|
||||
<Layout>
|
||||
<Routes>
|
||||
<Route path="/" element={<DashboardPage />} />
|
||||
<Route path="/hoy" element={<HoyPage />} />
|
||||
<Route path="/planes/:id" element={<PlanDetallePage />} />
|
||||
<Route path="/nuevo" element={<NuevoPlanPage />} />
|
||||
<Route path="*" element={<DashboardPage />} />
|
||||
</Routes>
|
||||
</Layout>
|
||||
</AuthGate>
|
||||
</BrowserRouter>
|
||||
</StrictMode>,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user