diff --git a/docs/superpowers/plans/2026-05-15-sprint2a-auth.md b/docs/superpowers/plans/2026-05-15-sprint2a-auth.md new file mode 100644 index 00000000..6a2f3110 --- /dev/null +++ b/docs/superpowers/plans/2026-05-15-sprint2a-auth.md @@ -0,0 +1,424 @@ +# Sprint 2 Plan A — Auth subsystem (A2/A3 + A7) Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Remove the orphaned `/recovery` RecoveryCodesView page (dead code) and make the `/legal/offer` & `/legal/privacy` footer links resolve to real stub pages instead of a 404. + +**Architecture:** Two independent, atomic changes. (1) Delete the `/recovery` route + `RecoveryCodesView.vue` + its story + spec — the real 2FA recovery-codes flow lives entirely in Settings → Безопасность (`TwoFactorCard.vue` setup wizard shows codes inline; `RecoveryCodesCard.vue` regenerates them), and nothing in the UI navigates to `/recovery`. (2) Add a single DRY `LegalDocView.vue` served by a `/legal/:doc(offer|privacy)` route, rendering an honest "document being finalized" stub (real legal text needs юр. редактура — реестр K3 / blocker Б-1). Upgrade the AuthLayout footer links from raw `` to ``. + +**Tech Stack:** Vue 3 ` + + + + +``` + +- [ ] **Step 4: Register the route in `app/resources/js/router/index.ts`** + +Add this route object to the `routes` array **before** the catch-all `/:pathMatch(.*)*` route (placing it just after the `/recovery-use` route, with the other auth-layout routes, is fine): + +```ts + { + path: '/legal/:doc(offer|privacy)', + name: 'legal', + component: () => import('../views/legal/LegalDocView.vue'), + meta: { layout: 'auth', title: 'Правовые документы' }, + }, +``` + +No `requiresAuth` / `guestOnly` — legal pages are public (a logged-in user may also read them). No `devIndex` — the page is not part of the temporary dev-index walkthrough. + +- [ ] **Step 5: Run the test to verify it passes** + +```bash +cd app && npx vitest run tests/Frontend/LegalDocView.spec.ts +``` + +Expected: **PASS** — 4/4 tests. + +- [ ] **Step 6: Add SPA routes to `app/routes/web.php`** + +Add these two lines next to the other auth `Route::view` entries (e.g. after `Route::view('/recovery-use', 'welcome');`): + +```php +Route::view('/legal/offer', 'welcome'); +Route::view('/legal/privacy', 'welcome'); +``` + +This makes a hard browser load / refresh of `/legal/offer` serve the SPA shell (consistent with the project's explicit-route convention). + +- [ ] **Step 7: Upgrade the footer links in `app/resources/js/layouts/AuthLayout.vue`** + +Replace the raw anchors (currently at lines ~47-48): + +```vue + Оферта + Политика +``` + +with `RouterLink`s (SPA navigation, no full page reload): + +```vue + Оферта + Политика +``` + +Leave the `v8 · Forest` line and the `.bp-foot` wrapper unchanged. `RouterLink` renders a plain `` element, so any existing `.bp-foot a { ... }` style rules continue to apply unchanged — no `