From cc2b11e705a82bb8a031fa70730b4e4ba0217f26 Mon Sep 17 00:00:00 2001 From: Alberto Maghini Date: Fri, 12 Jan 2024 13:36:16 +0100 Subject: [PATCH] test: fixed --- __tests__/ZitadelStrategy.test.ts | 3 +++ src/strategies/ZitadelStrategy.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/__tests__/ZitadelStrategy.test.ts b/__tests__/ZitadelStrategy.test.ts index 3554ad3..50fccae 100644 --- a/__tests__/ZitadelStrategy.test.ts +++ b/__tests__/ZitadelStrategy.test.ts @@ -41,6 +41,9 @@ describe("ZitadelStrategy", () => { ], }, ], + admin: { + user: "test-slug", + }, }); strategy = new ZitadelStrategy( { diff --git a/src/strategies/ZitadelStrategy.ts b/src/strategies/ZitadelStrategy.ts index baacd3b..a3fb69d 100644 --- a/src/strategies/ZitadelStrategy.ts +++ b/src/strategies/ZitadelStrategy.ts @@ -31,7 +31,7 @@ export class ZitadelStrategy extends Strategy { this.slug = collectionSlug; const collection = ctx.collections[collectionSlug]; this.collectionHaveEmailField = - !collection.config.auth?.disableLocalStrategy; + !collection?.config?.auth?.disableLocalStrategy; } createPassword(