Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

account for weird Azure AD types

Steven Tey1b8fb3d88bc9
diff --git a/pages/api/scim/v2.0/[...directory].ts b/pages/api/scim/v2.0/[...directory].ts
index 1d180f067f..80ccc37b05 100644
--- a/pages/api/scim/v2.0/[...directory].ts
+++ b/pages/api/scim/v2.0/[...directory].ts
@@ -95,7 +95,11 @@ const handleEvents = async (event: DirectorySyncEvent) => {
}
// User has been activated
- if (action === "user.updated" && data.active === true) {
+ if (
+ action === "user.updated" &&
+ // @ts-ignore – data.active can be a string (from Azure AD)
+ (data.active === true || data.active === "True")
+ ) {
if (!userInProject && !userInvited) {
await inviteUser({
email: data.email,
@@ -106,7 +110,9 @@ const handleEvents = async (event: DirectorySyncEvent) => {
// User has been deactivated or deleted
if (
- (action === "user.updated" && data.active === false) ||
+ (action === "user.updated" &&
+ // @ts-ignore – data.active can be a string (from Azure AD)
+ (data.active === false || data.active === "False")) ||
action === "user.deleted"
) {
if (userInProject) {