@nextsparkjs/core 0.1.0-beta.175 → 0.1.0-beta.176

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  {
2
- "generated": "2026-06-28T22:03:02.165Z",
2
+ "generated": "2026-06-28T23:29:37.388Z",
3
3
  "totalClasses": 1081,
4
4
  "classes": [
5
5
  "!text-2xl",
@@ -170,15 +170,24 @@ export const POST = withRateLimitTier(withApiLogging(
170
170
  return addCorsHeaders(response)
171
171
  }
172
172
 
173
+ // Steps 3-4 run via the service pool (RLS bypass). This is a trusted
174
+ // server flow: the invite token was validated above and the account was
175
+ // just created, so there is no invitee session to drive RLS — and a
176
+ // `SET LOCAL app.user_id` context does not reliably propagate to the
177
+ // membership INSERT over a pooled (PgBouncer) connection, which makes the
178
+ // team_members self-join policy intermittently reject it. Writing as the
179
+ // service role sidesteps that; every row carries explicit ids.
180
+
173
181
  // Step 3: Mark email as verified (skip email verification since invitation proves email ownership)
174
182
  await mutateWithRLS(
175
183
  'UPDATE "users" SET "emailVerified" = true, "updatedAt" = CURRENT_TIMESTAMP WHERE id = $1',
176
184
  [userId],
177
- userId
185
+ undefined,
186
+ { service: true }
178
187
  )
179
188
 
180
189
  // Step 4: Accept the invitation (add user to team)
181
- const tx = await getTransactionClient(userId)
190
+ const tx = await getTransactionClient(userId, { service: true })
182
191
 
183
192
  try {
184
193
  // Add user as team member
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextsparkjs/core",
3
- "version": "0.1.0-beta.175",
3
+ "version": "0.1.0-beta.176",
4
4
  "description": "NextSpark - The complete SaaS framework for Next.js",
5
5
  "license": "MIT",
6
6
  "author": "NextSpark <hello@nextspark.dev>",
@@ -469,7 +469,7 @@
469
469
  "tailwind-merge": "^3.3.1",
470
470
  "uuid": "^13.0.0",
471
471
  "zod": "^4.1.5",
472
- "@nextsparkjs/testing": "0.1.0-beta.175"
472
+ "@nextsparkjs/testing": "0.1.0-beta.176"
473
473
  },
474
474
  "scripts": {
475
475
  "postinstall": "node scripts/postinstall.mjs || true",
@@ -170,15 +170,24 @@ export const POST = withRateLimitTier(withApiLogging(
170
170
  return addCorsHeaders(response)
171
171
  }
172
172
 
173
+ // Steps 3-4 run via the service pool (RLS bypass). This is a trusted
174
+ // server flow: the invite token was validated above and the account was
175
+ // just created, so there is no invitee session to drive RLS — and a
176
+ // `SET LOCAL app.user_id` context does not reliably propagate to the
177
+ // membership INSERT over a pooled (PgBouncer) connection, which makes the
178
+ // team_members self-join policy intermittently reject it. Writing as the
179
+ // service role sidesteps that; every row carries explicit ids.
180
+
173
181
  // Step 3: Mark email as verified (skip email verification since invitation proves email ownership)
174
182
  await mutateWithRLS(
175
183
  'UPDATE "users" SET "emailVerified" = true, "updatedAt" = CURRENT_TIMESTAMP WHERE id = $1',
176
184
  [userId],
177
- userId
185
+ undefined,
186
+ { service: true }
178
187
  )
179
188
 
180
189
  // Step 4: Accept the invitation (add user to team)
181
- const tx = await getTransactionClient(userId)
190
+ const tx = await getTransactionClient(userId, { service: true })
182
191
 
183
192
  try {
184
193
  // Add user as team member