whisper-money/resources/js/components/onboarding
Víctor Falcón aa3b811027
refactor(js): extract shared getCsrfToken util (#475)
## What

Same XSRF-TOKEN cookie-parsing snippet was duplicated inline in **12
files** (some as local `getCsrfToken()` copies, some inline
`decodeURIComponent(...)` blocks).

Extracted to single util: `resources/js/lib/csrf.ts`, with vitest
coverage.

## Why

Part of duplication-removal series — PRs that mostly delete code.

## Stats

- App code: **-89 / +23 lines**
- 12 files now import one shared util
- New: `lib/csrf.ts` (8 lines) + `lib/csrf.test.ts`

## Checks

- `bun run test` — 154 pass (3 new)
- `bun run lint` — clean (1 pre-existing warning in chart.tsx)
- `bun run format` — applied
- `tsc --noEmit` — 59 pre-existing errors on main, same 59 on branch
(none introduced)
2026-06-03 17:26:09 +02:00
..
step-account-types.tsx refactor(real-estate): remove Pennant gating (#308) 2026-04-20 13:31:49 +01:00
step-button.tsx User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
step-categorize-transactions.tsx fix: preview categorizer rule application (#421) 2026-05-25 10:24:21 +02:00
step-category-types.tsx feat: Spanish localization (#74) 2026-02-08 11:58:08 +01:00
step-complete.tsx feat(subscription): allow free plan for open banking users without connected banks (#188) 2026-03-03 22:28:50 +00:00
step-create-account.tsx refactor(js): extract shared getCsrfToken util (#475) 2026-06-03 17:26:09 +02:00
step-customize-categories.tsx feat: Spanish localization (#74) 2026-02-08 11:58:08 +01:00
step-header.tsx User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
step-import-balances.tsx feat: Spanish localization (#74) 2026-02-08 11:58:08 +01:00
step-import-transactions.tsx Fix transaction importer account preselect (#396) 2026-05-14 12:38:44 +02:00
step-smart-rules.tsx feat: (Onboarding) add categorization intro screen with benefit cards (#201) 2026-03-05 11:47:12 +01:00
step-syncing.tsx fix(browser-test): reload transactions in syncing step and fix Skip button selector (#203) 2026-03-05 11:29:06 +00:00
step-welcome.tsx feat: Spanish localization (#74) 2026-02-08 11:58:08 +01:00