new-site/api
justin 9c87759501 auth: make ERPNext the single source of truth for customer passwords
Customer portal login previously checked a bcrypt customers.password_hash
in Postgres, while portal.performancewest.net validated against ERPNext —
two stores that drifted (the Paul Wilson lockout). Consolidate on ERPNext:

- erpnext-client: add verifyWebsiteUserPassword() — delegates the credential
  check to Frappe /api/method/login (Host header = site name; 200=ok,401=bad).
- portal-auth /login: verify against ERPNext, then mint the pw_customer cookie.
- portal-auth /register: create+set the ERPNext password (authority) and upsert
  a password-less customers profile row; takeover guard still honors any legacy
  PG password until the column is dropped.
- portal-auth /reset-password + /forgot-password: write the new password to
  ERPNext; forgot-password now also works for ERPNext-only users (creates the
  PG profile row on demand).
- Legacy customers with only a PG bcrypt password reset via forgot-password.
- checkout: refresh the stale comment (customers row is now a profile, no pw).

Build + typecheck green.
2026-06-17 10:09:32 -05:00
..
migrations feat(govfee): auto-quote + collect state fees for at-cost trucking services 2026-06-16 04:35:45 -05:00
src auth: make ERPNext the single source of truth for customer passwords 2026-06-17 10:09:32 -05:00
test esign: make signing copy fully generic - remove all ink references from website/API 2026-06-07 05:06:26 -05:00
Dockerfile Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
package-lock.json Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
package.json Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
start-dev.sh Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00
tsconfig.json Initial commit — Performance West telecom compliance platform 2026-04-27 06:54:22 -05:00