From 38ae00714b04e45f0bbf29aaf7e59d5102662317 Mon Sep 17 00:00:00 2001 From: tangoyankee Date: Mon, 13 May 2024 15:01:42 -0400 Subject: [PATCH] express which sharepoint credential missing --- server/src/provider/msal.provider.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/server/src/provider/msal.provider.ts b/server/src/provider/msal.provider.ts index b7135206..303ed1b5 100644 --- a/server/src/provider/msal.provider.ts +++ b/server/src/provider/msal.provider.ts @@ -17,14 +17,11 @@ export const MsalProvider: FactoryProvider = { "SHAREPOINT_CLIENT_SECRET" ); const siteId: string | undefined = config.get("SHAREPOINT_SITE_ID"); - if ( - tenantId === undefined || - clientId === undefined || - clientSecret === undefined || - siteId === undefined - ) { - throw new Error("Missing SharePoint credential"); - } + + if(tenantId === undefined) throw new Error("Missing tenant id"); + if(clientId === undefined) throw new Error("Missing sharepoint client id"); + if(clientSecret === undefined) throw new Error("Missing sharepoint client secret"); + if(siteId === undefined) throw new Error("Missing sharepoint site id"); const cca = new msal.ConfidentialClientApplication({ auth: {