@rebasepro/common 0.9.1-canary.ff338b5 → 0.10.0

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/dist/index.es.js CHANGED
@@ -788,7 +788,7 @@ function getSubcollections(collection) {
788
788
  * It handles:
789
789
  * - `field = 'literal'`
790
790
  * - `field != 'literal'`
791
- * - `field = current_setting('app.user_id')`
791
+ * - `field = current_setting('app.uid')` (or the legacy `app.user_id`)
792
792
  * - `A AND B`, `A OR B` — only where the keyword is at the top level
793
793
  * - `true`
794
794
  * - `IN (...)` (as optimistic true)
@@ -989,7 +989,7 @@ function findAnonymousGrants(expr) {
989
989
  return found;
990
990
  }
991
991
  function parseOperand(str) {
992
- if (/current_setting\s*\(\s*'app\.user_id'\s*\)/i.test(str) || /auth\.uid\(\)/i.test(str)) return policy.authUid();
992
+ if (/current_setting\s*\(\s*'app\.(uid|user_id)'\s*\)/i.test(str) || /auth\.uid\(\)/i.test(str)) return policy.authUid();
993
993
  const stringMatch = str.match(/^'(.+)'$/);
994
994
  if (stringMatch) return policy.literal(stringMatch[1]);
995
995
  if (/^\w+$/.test(str)) return policy.field(str);