From f46dfbf2d36656def2493ba17276dfbb9e2d4343 Mon Sep 17 00:00:00 2001 From: Laura Beatris <48022589+LauraBeatris@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:32:05 -0300 Subject: [PATCH] Fix JSDocs for `org_permissions` --- .../nextjs/src/server/__tests__/clerkMiddleware.test.ts | 7 +++++++ packages/types/src/jwtv2.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/nextjs/src/server/__tests__/clerkMiddleware.test.ts b/packages/nextjs/src/server/__tests__/clerkMiddleware.test.ts index 9d06d9e10a..5d2429fb16 100644 --- a/packages/nextjs/src/server/__tests__/clerkMiddleware.test.ts +++ b/packages/nextjs/src/server/__tests__/clerkMiddleware.test.ts @@ -113,6 +113,13 @@ describe('ClerkMiddleware type tests', () => { clerkMiddlewareMock(); }); + it('prevents usage of system permissions with auth.has()', () => { + clerkMiddlewareMock(async (auth, _event, _request) => { + // @ts-expect-error - system permissions are not allowed + (await auth()).has({ permission: 'org:sys_foo' }); + }); + }); + describe('Multi domain', () => { const defaultProps = { publishableKey: '', secretKey: '' }; diff --git a/packages/types/src/jwtv2.ts b/packages/types/src/jwtv2.ts index 73ef4232f4..3bd27594f9 100644 --- a/packages/types/src/jwtv2.ts +++ b/packages/types/src/jwtv2.ts @@ -97,7 +97,7 @@ export interface JwtPayload extends CustomJwtSessionClaims { org_role?: OrganizationCustomRoleKey; /** - * Active organization role + * Active organization permissions */ org_permissions?: OrganizationCustomPermissionKey[];