From 36d30f53ef97be242e33280068fabf9fd8dfdfee Mon Sep 17 00:00:00 2001 From: derekpierre Date: Wed, 18 Dec 2024 11:53:37 -0500 Subject: [PATCH] Apply outstanding RFCs from #602. --- packages/taco/src/conditions/context/context.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/taco/src/conditions/context/context.ts b/packages/taco/src/conditions/context/context.ts index dd4a2815..2636a2b8 100644 --- a/packages/taco/src/conditions/context/context.ts +++ b/packages/taco/src/conditions/context/context.ts @@ -16,6 +16,7 @@ import { ConditionExpression } from '../condition-expr'; import { CONTEXT_PARAM_FULL_MATCH_REGEXP, CONTEXT_PARAM_PREFIX, + CONTEXT_PARAM_REGEXP, USER_ADDRESS_PARAMS, } from '../const'; import { JsonApiConditionType } from '../schemas/json-api'; @@ -190,14 +191,15 @@ export class ConditionContext { } } if (condition.query) { - const queryParams = condition.query.match(':[a-zA-Z_]+'); + const queryParams = condition.query.match(CONTEXT_PARAM_REGEXP); if (queryParams) { for (const param of queryParams) { requestedParameters.add(param); } } } - if (this.isContextParameter(condition.authorizationToken)) { + // always a context variable, so simply check whether defined + if (condition.authorizationToken) { requestedParameters.add(condition.authorizationToken); } }