Add debug logging

This commit is contained in:
Tom Moor committed 2024-10-16 18:41:21 -04:00
1 parent 9b807f7a9e
commit be62497f2a
1 file changed
+13
+13
View File
@@ -8,6 +8,7 @@ import { slugifyDomain } from "@shared/utils/domains";
import { parseEmail } from "@shared/utils/email";
import accountProvisioner from "@server/commands/accountProvisioner";
import { MicrosoftGraphError } from "@server/errors";
import Logger from "@server/logging/Logger";
import passportMiddleware from "@server/middlewares/passport";
import { User } from "@server/models";
import { AuthenticationResult } from "@server/types";
@@ -75,6 +76,18 @@ if (env.AZURE_CLIENT_ID && env.AZURE_CLIENT_SECRET) {
);
}
if (!organizationResponse.value) {
Logger.info(
"authentication",
"API response missing value key",
organizationResponse
);
throw MicrosoftGraphError(
"Unable to load organization value from Microsoft Graph API"
);
}
const organization = organizationResponse.value[0];
// Note: userPrincipalName is last here for backwards compatibility with