Skip to content

Commit

Permalink
fix(keto-client-wrapper): update OryAuthorizationGuard to allow null …
Browse files Browse the repository at this point in the history
…type for parentType and fill empty array
  • Loading branch information
getlarge committed Feb 1, 2025
1 parent ae4aff0 commit 0828fdc
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const OryAuthorizationGuard = (
factory: EnhancedRelationTupleFactory,
context: ExecutionContext,
parentType: 'AND' | 'OR' | null = null
): { tuple: Relationship; relation: string; type: 'AND' | 'OR' }[] {
): { tuple: Relationship; relation: string; type: 'AND' | 'OR' | null }[] {
const { unauthorizedFactory } = this.options;

if (typeof factory === 'string' || typeof factory === 'function') {
Expand All @@ -113,7 +113,7 @@ export const OryAuthorizationGuard = (
{
tuple: result.value,
relation: relationTuple,
type: parentType || 'AND',
type: parentType || null,
},
];
}
Expand Down Expand Up @@ -204,7 +204,7 @@ export const OryAuthorizationGuard = (

const permissionResults: boolean[] = new Array(
flattenedConditions.length
);
).fill(false);

try {
for (const { tuple, index } of partialTuples) {
Expand Down

0 comments on commit 0828fdc

Please sign in to comment.