Skip to content

Commit

Permalink
express which sharepoint credential missing
Browse files Browse the repository at this point in the history
  • Loading branch information
TangoYankee committed May 13, 2024
1 parent d55c23d commit 38ae007
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions server/src/provider/msal.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@ export const MsalProvider: FactoryProvider<MsalProviderType> = {
"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: {
Expand Down

0 comments on commit 38ae007

Please sign in to comment.