Skip to content

Commit 4f09d07

Browse files
committed
fix(admin): reject NaN and Infinity in amount validation
1 parent 3bb85f2 commit 4f09d07

File tree

1 file changed

+1
-1
lines changed
  • apps/sim/app/api/v1/admin/credits

1 file changed

+1
-1
lines changed

apps/sim/app/api/v1/admin/credits/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const POST = withAdminAuth(async (request) => {
5151
return badRequestResponse('Either userId or email is required')
5252
}
5353

54-
if (typeof amount !== 'number' || amount <= 0) {
54+
if (typeof amount !== 'number' || !Number.isFinite(amount) || amount <= 0) {
5555
return badRequestResponse('amount must be a positive number')
5656
}
5757

0 commit comments

Comments
 (0)