Skip to content

fix(sponsor): reject non-numeric amount types - #84

Open
aiirvizionz wants to merge 1 commit into
profullstack:masterfrom
aiirvizionz:clientkit/sponsor-amount-reject-non-numeric-types
Open

fix(sponsor): reject non-numeric amount types#84
aiirvizionz wants to merge 1 commit into
profullstack:masterfrom
aiirvizionz:clientkit/sponsor-amount-reject-non-numeric-types

Conversation

@aiirvizionz

Copy link
Copy Markdown
Contributor

Summary

  • reject sponsor amount payloads that are not strings or numbers before numeric coercion
  • keep existing decimal string validation and finite/minimum checks
  • add regression coverage for array, object, and boolean values

Why

The prior decimal-string guard prevents inputs like 1e2 and 0x10, but non-string payloads could still pass through JavaScript numeric coercion. For example, [5] can become 5 via Number([5]). Sponsor checkout should only accept explicit string/number amount values.

Validation

  • vitest run apps/web/lib/sponsor-amount.test.ts (5 tests passed)

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.

1 participant