Skip to content

Handle malformed login request bodies#191

Open
morganschp wants to merge 1 commit into
profullstack:masterfrom
morganschp:fix-auth-login-invalid-json
Open

Handle malformed login request bodies#191
morganschp wants to merge 1 commit into
profullstack:masterfrom
morganschp:fix-auth-login-invalid-json

Conversation

@morganschp
Copy link
Copy Markdown

Summary

  • parse login request bodies with the existing safe JSON helper
  • return 400 Invalid request body for malformed, empty, or non-object JSON
  • add a regression test proving malformed JSON does not call Supabase sign-in

Fixes #190

uGig task

Submitted for the active uGig repo testing task: https://ugig.net/gigs/4741218f-a723-46bb-82cb-6516120331ae

No payout details included; those can be provided after acceptance.

Tests

  • ./node_modules/.bin/vitest run src/app/api/auth/login/route.test.ts
  • ./node_modules/.bin/eslint src/app/api/auth/login/route.ts src/app/api/auth/login/route.test.ts
  • ./node_modules/.bin/tsc --noEmit
  • git diff --check -- src/app/api/auth/login/route.ts src/app/api/auth/login/route.test.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: login API returns 500 on malformed JSON

1 participant