From c47349b9dcf2067b7b572c5463b15b2a8fbda972 Mon Sep 17 00:00:00 2001 From: Christoph Wiechert Date: Fri, 31 Mar 2023 19:57:19 +0200 Subject: [PATCH] fix(authentication): Ensure authentication.entity configuration can be null (#3136) --- packages/typebox/src/default-schemas.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/typebox/src/default-schemas.ts b/packages/typebox/src/default-schemas.ts index 3823e6c5b7..cf17a3f056 100644 --- a/packages/typebox/src/default-schemas.ts +++ b/packages/typebox/src/default-schemas.ts @@ -2,7 +2,12 @@ import { Type, Static } from '@sinclair/typebox' export const authenticationSettingsSchema = Type.Object({ secret: Type.String({ description: 'The JWT signing secret' }), - entity: Type.Optional(Type.String({ description: 'The name of the authentication entity (e.g. user)' })), + entity: Type.Optional( + Type.Union([ + Type.String({ description: 'The name of the authentication entity (e.g. user)' }), + Type.Null() + ]) + ), entityId: Type.Optional(Type.String({ description: 'The name of the authentication entity id property' })), service: Type.Optional(Type.String({ description: 'The path of the entity service' })), authStrategies: Type.Array(Type.String(), {