1.3 KiB
1.3 KiB
WRNexusJS auth form and validation fix
Copy this patch over the WRNexusJS repository root (E:\WireJS) and allow matching files to be replaced.
What this fixes
- Auth API files now export HTTP method handlers (
GET/POST) instead of unsupported default-only handlers. - The package auth dispatcher exports
GETandPOST, so package-contributed API routes are callable by the runtime. - The sign-up form is intercepted by the
@wrnexus/validationbrowser runtime instead of navigating the browser directly to the JSON API. - The same
signUpSchemavalidates registration in the browser and in the showcase API route. - Shared auth HTTP handlers validate core request bodies with
parseBody(...)from@wrnexus/validation. - Backend field errors and network/API failures are displayed in the form.
- Successful registration redirects to
/sign-in. - The in-memory auth showcase disables SQL migration bundling, so its production build does not require
config.db.
Run
cd E:/WireJS
bun install
bun run format
bun run check
bun run validate:auth
bun run auth:dev
Open:
http://localhost:3000/sign-up
Do not use /api/auth/register as the registration page. It is a POST-only JSON endpoint. Opening it directly with GET should now return a JSON 405 Method Not Allowed response instead of an invalid server response.