diff --git a/.nvmrc b/.nvmrc index 2ab3d4b..016e34b 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v16.20.2 +v20.17.0 diff --git a/src/lib/app.ts b/src/lib/app.ts index 4e6f989..4159d06 100644 --- a/src/lib/app.ts +++ b/src/lib/app.ts @@ -143,8 +143,12 @@ async function scimUserByEmail( headers: { Authorization: `Bearer ${app.scimBearerToken}` }, }); const listBody = await listResponse.json(); - if (listBody?.Resources?.length > 0) { - return listBody.Resources[0].id; + + // in practice, SCIM servers put the results into either `resources` or + // `Resources` + const resources = listBody?.resources ?? listBody?.Resources ?? [] + if (resources.length > 0) { + return resources[0].id; } return undefined; }