@everystack/api 0.2.2 → 0.2.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everystack/api",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "PostgREST-compatible HTTP handler + typed fetch client for Drizzle ORM",
5
5
  "license": "AGPL-3.0-only",
6
6
  "publishConfig": {
@@ -431,14 +431,12 @@ export function createHandler(db: DrizzleDb, schema: Schema, options?: HandlerOp
431
431
  // 1. Header-based (native/server): X-Client-Id + X-Client-Secret
432
432
  // 2. Referer-based (web): Referer or Origin header (no secrets in browser source)
433
433
  // The verifyClient callback receives all three and decides which path to validate.
434
- // Skipped for publicRoutes methods (e.g. GET) and publicRpc functions — no credentials needed.
434
+ // Skipped for publicRoutes methods (e.g. GET) — no credentials needed.
435
+ // publicRpc skips JWT verification only, NOT client auth.
435
436
  let user: Record<string, unknown> | null = null;
436
437
  let client: Record<string, unknown> | null = null;
437
438
  const isPublicRoute = options?.auth?.publicRoutes?.includes(method) ?? false;
438
- const isPublicRpc = pathSegments[0] === 'rpc'
439
- && !!pathSegments[1]
440
- && (options?.auth?.publicRpc?.includes(pathSegments[1]) ?? false);
441
- if (options?.auth?.verifyClient && !isPublicRoute && !isPublicRpc) {
439
+ if (options?.auth?.verifyClient && !isPublicRoute) {
442
440
  const idHeader = options.auth.clientHeaders?.id ?? 'X-Client-Id';
443
441
  const secretHeader = options.auth.clientHeaders?.secret ?? 'X-Client-Secret';
444
442
  const clientId = request.headers.get(idHeader);