Skip to content
TypeScript

fix(server): pairing tokens work on Node versions that cannot bind booleans (#16730)

chise4daec109cdf8
diff --git a/apps/server/src/persistence/AuthPairingLinks.ts b/apps/server/src/persistence/AuthPairingLinks.ts
index ca18088b4bf..623fc8159db 100644
--- a/apps/server/src/persistence/AuthPairingLinks.ts
+++ b/apps/server/src/persistence/AuthPairingLinks.ts
@@ -172,7 +172,7 @@ export const make = Effect.gen(function* () {
proof_key_thumbprint IS NULL
OR proof_key_thumbprint = ${proofKeyThumbprint}
)
- AND (${requestedScopes === undefined} OR EXISTS (
+ AND (${requestedScopes === undefined ? 1 : 0} OR EXISTS (
SELECT 1
FROM json_each(${JSON.stringify(requestedScopes ?? [])}) AS requested
WHERE requested.value IN (