whisper-money/resources/js
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
..
components refactor(js): extract shared getCsrfToken util (#475) 2026-06-03 17:26:09 +02:00
contexts Move transaction filtering from client-side to server-side (#126) 2026-02-16 12:49:04 +01:00
hooks feat(cashflow): add savings and period views (#424) 2026-05-25 16:41:00 +02:00
layouts feat(open-banking): remove feature flag gating (#297) 2026-04-17 10:20:05 +02:00
lib refactor(js): extract shared getCsrfToken util (#475) 2026-06-03 17:26:09 +02:00
pages refactor(js): extract shared getCsrfToken util (#475) 2026-06-03 17:26:09 +02:00
providers fix: move community link to user menu (#442) 2026-05-27 17:39:26 +02:00
services feat(transactions): add counterparty fields (#440) 2026-05-27 16:20:55 +02:00
types feat(importer): support YYYYMMDD date format (#470) 2026-06-01 16:44:46 +02:00
utils feat(currencies): add Colombian and Dominican peso (#471) 2026-06-01 18:14:16 +02:00
app.tsx fix(sentry): only report errors in production (#467) 2026-06-01 12:41:31 +02:00
ssr.tsx Remove plaintext-transactions feature flag & E2E references (#116) 2026-02-13 11:10:21 +01:00