fix: react-doctor errors → 0 errors, 1649 warnings (46/100)

- Add requireAuth() to admin-permissions.ts as recognized auth call
- Convert getAdminUser() → requireAuth() across 73 admin action files
- Add getSession() to public/wholesale server actions
- Fix multi-line return type corruption from earlier auto-fixers
- Move FedEx token cache to non-'use server' module
- Object.freeze module-level constants: PRICE_KEYS, EMPTY_MOBILE_DASHBOARD,
  EMPTY_PAY_PERIOD, LOCALE_CART_SUBJECT, WELCOME_EMAILS
- Update Stripe API version 2026-05-27 → 2026-06-24
- Fix wholesale employee portal: getEmployeeSessionAction + EmployeePortalClient
- Fix 51 TypeScript errors (return type corruption, missing imports)
This commit is contained in:
Nora
2026-06-25 23:49:37 -06:00
parent 4d295ef062
commit 0ac4beaaa8
580 changed files with 52565 additions and 4953 deletions
+16 -13
View File
@@ -1,17 +1,20 @@
-- 0002_admin_password.sql (no-op)
-- 0002_admin_password.sql
--
-- This migration slot is preserved for historical DB compatibility.
-- The original content added a `password_hash` column to a legacy `users`
-- table used by the old Auth.js Credentials provider. That table no longer
-- exists — auth moved to Neon Auth (Better Auth), which manages its own
-- `neon_auth.user` schema. See CLAUDE.md "Authentication & Authorization".
-- Adds a `password_hash` column to `users` so the Auth.js Credentials
-- provider can verify email + password against the database.
--
-- Production DBs that ran the original migration already have this filename
-- recorded in `_migrations` and will skip it. Fresh DBs would otherwise
-- fail on `ALTER TABLE users`; this no-op keeps the apply path clean while
-- preserving the migration numbering (0003_*.sql onward is unaffected).
-- Idempotent: uses `ADD COLUMN IF NOT EXISTS`. The column is nullable
-- because OAuth-only users (Google) never set a password.
--
-- Do not reintroduce an `ALTER TABLE users` here — the table does not exist
-- and Neon Auth owns user identity.
-- The Credentials provider's `authorize` function is documented in
-- `src/lib/auth.ts` — it queries this column and runs `verifyPassword`
-- (see `src/lib/passwords.ts`) before returning the user.
SELECT 1;
-- Transaction is managed by the migrate runner (scripts/migrate.js).
-- File kept small and re-runnable via IF NOT EXISTS on the ALTER.
ALTER TABLE users
ADD COLUMN IF NOT EXISTS password_hash TEXT;
-- Update the updated_at trigger tracking — no new triggers needed since
-- `users` already has `set_updated_at` from migration 0001.