Spaces:
Sleeping
Sleeping
fix: fix error message
Browse filesSigned-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
- src/resources/(groups)/[groupId]/index.ts +2 -2
- src/resources/(groups)/index.ts +2 -2
- src/resources/(users)/[userId]/index.ts +2 -2
- src/resources/(users)/index.ts +2 -2
- src/tools/addUserToGroup.ts +2 -2
- src/tools/createGroup.ts +2 -2
- src/tools/createUser.ts +2 -2
- src/tools/deleteGroup.ts +2 -2
- src/tools/deleteUser.ts +2 -2
- src/tools/patchGroup.ts +2 -2
- src/tools/patchUser.ts +2 -2
- src/tools/removeUserFromGroup.ts +2 -2
- src/tools/replaceGroup.ts +2 -2
- src/tools/replaceUser.ts +2 -2
src/resources/(groups)/[groupId]/index.ts
CHANGED
|
@@ -45,11 +45,11 @@ export default async function handler({
|
|
| 45 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 46 |
|
| 47 |
if (!apiToken) {
|
| 48 |
-
throw new Error("Missing required headers: x-scim-api-token");
|
| 49 |
}
|
| 50 |
|
| 51 |
if (!baseUrl) {
|
| 52 |
-
throw new Error("Missing required headers: x-scim-base-url");
|
| 53 |
}
|
| 54 |
|
| 55 |
const url = new URL(`${baseUrl}/Groups/${groupId}`);
|
|
|
|
| 45 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 46 |
|
| 47 |
if (!apiToken) {
|
| 48 |
+
throw new Error("Missing required headers: x-scim-api-token or SCIM_API_TOKEN env");
|
| 49 |
}
|
| 50 |
|
| 51 |
if (!baseUrl) {
|
| 52 |
+
throw new Error("Missing required headers: x-scim-base-url or SCIM_API_BASE_URL env");
|
| 53 |
}
|
| 54 |
|
| 55 |
const url = new URL(`${baseUrl}/Groups/${groupId}`);
|
src/resources/(groups)/index.ts
CHANGED
|
@@ -50,11 +50,11 @@ export default async function handler({
|
|
| 50 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 51 |
|
| 52 |
if (!apiToken) {
|
| 53 |
-
throw new Error("Missing required headers: x-scim-api-token");
|
| 54 |
}
|
| 55 |
|
| 56 |
if (!baseUrl) {
|
| 57 |
-
throw new Error("Missing required headers: x-scim-base-url");
|
| 58 |
}
|
| 59 |
|
| 60 |
const url = new URL(`${baseUrl}/Groups`);
|
|
|
|
| 50 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 51 |
|
| 52 |
if (!apiToken) {
|
| 53 |
+
throw new Error("Missing required headers: x-scim-api-token or SCIM_API_TOKEN env");
|
| 54 |
}
|
| 55 |
|
| 56 |
if (!baseUrl) {
|
| 57 |
+
throw new Error("Missing required headers: x-scim-base-url or SCIM_API_BASE_URL env");
|
| 58 |
}
|
| 59 |
|
| 60 |
const url = new URL(`${baseUrl}/Groups`);
|
src/resources/(users)/[userId]/index.ts
CHANGED
|
@@ -45,11 +45,11 @@ export default async function handler({
|
|
| 45 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 46 |
|
| 47 |
if (!apiToken) {
|
| 48 |
-
throw new Error("Missing required headers: x-scim-api-token");
|
| 49 |
}
|
| 50 |
|
| 51 |
if (!baseUrl) {
|
| 52 |
-
throw new Error("Missing required headers: x-scim-base-url");
|
| 53 |
}
|
| 54 |
|
| 55 |
const url = new URL(`${baseUrl}/Users/${userId}`);
|
|
|
|
| 45 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 46 |
|
| 47 |
if (!apiToken) {
|
| 48 |
+
throw new Error("Missing required headers: x-scim-api-token or SCIM_API_TOKEN env");
|
| 49 |
}
|
| 50 |
|
| 51 |
if (!baseUrl) {
|
| 52 |
+
throw new Error("Missing required headers: x-scim-base-url or SCIM_API_BASE_URL env");
|
| 53 |
}
|
| 54 |
|
| 55 |
const url = new URL(`${baseUrl}/Users/${userId}`);
|
src/resources/(users)/index.ts
CHANGED
|
@@ -50,11 +50,11 @@ export default async function handler({
|
|
| 50 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 51 |
|
| 52 |
if (!apiToken) {
|
| 53 |
-
throw new Error("Missing required headers: x-scim-api-token");
|
| 54 |
}
|
| 55 |
|
| 56 |
if (!baseUrl) {
|
| 57 |
-
throw new Error("Missing required headers: x-scim-base-url");
|
| 58 |
}
|
| 59 |
|
| 60 |
const url = new URL(`${baseUrl}/Users`);
|
|
|
|
| 50 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 51 |
|
| 52 |
if (!apiToken) {
|
| 53 |
+
throw new Error("Missing required headers: x-scim-api-token or SCIM_API_TOKEN env");
|
| 54 |
}
|
| 55 |
|
| 56 |
if (!baseUrl) {
|
| 57 |
+
throw new Error("Missing required headers: x-scim-base-url or SCIM_API_BASE_URL env");
|
| 58 |
}
|
| 59 |
|
| 60 |
const url = new URL(`${baseUrl}/Users`);
|
src/tools/addUserToGroup.ts
CHANGED
|
@@ -30,11 +30,11 @@ export default async function addUserToGroup(
|
|
| 30 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 31 |
|
| 32 |
if (!apiToken) {
|
| 33 |
-
throw new Error("Missing required headers: x-scim-api-token");
|
| 34 |
}
|
| 35 |
|
| 36 |
if (!baseUrl) {
|
| 37 |
-
throw new Error("Missing required headers: x-scim-base-url");
|
| 38 |
}
|
| 39 |
|
| 40 |
const { groupId, userId } = params;
|
|
|
|
| 30 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 31 |
|
| 32 |
if (!apiToken) {
|
| 33 |
+
throw new Error("Missing required headers: x-scim-api-token or SCIM_API_TOKEN env");
|
| 34 |
}
|
| 35 |
|
| 36 |
if (!baseUrl) {
|
| 37 |
+
throw new Error("Missing required headers: x-scim-base-url or SCIM_API_BASE_URL env");
|
| 38 |
}
|
| 39 |
|
| 40 |
const { groupId, userId } = params;
|
src/tools/createGroup.ts
CHANGED
|
@@ -36,11 +36,11 @@ export default async function createGroup(
|
|
| 36 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 37 |
|
| 38 |
if (!apiToken) {
|
| 39 |
-
throw new Error("Missing required headers: x-scim-api-token");
|
| 40 |
}
|
| 41 |
|
| 42 |
if (!baseUrl) {
|
| 43 |
-
throw new Error("Missing required headers: x-scim-base-url");
|
| 44 |
}
|
| 45 |
|
| 46 |
const response = await fetch(`${baseUrl}/Groups`, {
|
|
|
|
| 36 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 37 |
|
| 38 |
if (!apiToken) {
|
| 39 |
+
throw new Error("Missing required headers: x-scim-api-token or SCIM_API_TOKEN env");
|
| 40 |
}
|
| 41 |
|
| 42 |
if (!baseUrl) {
|
| 43 |
+
throw new Error("Missing required headers: x-scim-base-url or SCIM_API_BASE_URL env");
|
| 44 |
}
|
| 45 |
|
| 46 |
const response = await fetch(`${baseUrl}/Groups`, {
|
src/tools/createUser.ts
CHANGED
|
@@ -36,11 +36,11 @@ export default async function createUser(
|
|
| 36 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 37 |
|
| 38 |
if (!apiToken) {
|
| 39 |
-
throw new Error("Missing required headers: x-scim-api-token");
|
| 40 |
}
|
| 41 |
|
| 42 |
if (!baseUrl) {
|
| 43 |
-
throw new Error("Missing required headers: x-scim-base-url");
|
| 44 |
}
|
| 45 |
|
| 46 |
const response = await fetch(`${baseUrl}/Users`, {
|
|
|
|
| 36 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 37 |
|
| 38 |
if (!apiToken) {
|
| 39 |
+
throw new Error("Missing required headers: x-scim-api-token or SCIM_API_TOKEN env");
|
| 40 |
}
|
| 41 |
|
| 42 |
if (!baseUrl) {
|
| 43 |
+
throw new Error("Missing required headers: x-scim-base-url or SCIM_API_BASE_URL env");
|
| 44 |
}
|
| 45 |
|
| 46 |
const response = await fetch(`${baseUrl}/Users`, {
|
src/tools/deleteGroup.ts
CHANGED
|
@@ -28,11 +28,11 @@ export default async function deleteGroup(
|
|
| 28 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 29 |
|
| 30 |
if (!apiToken) {
|
| 31 |
-
throw new Error("Missing required headers: x-scim-api-token");
|
| 32 |
}
|
| 33 |
|
| 34 |
if (!baseUrl) {
|
| 35 |
-
throw new Error("Missing required headers: x-scim-base-url");
|
| 36 |
}
|
| 37 |
|
| 38 |
const { groupId } = params;
|
|
|
|
| 28 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 29 |
|
| 30 |
if (!apiToken) {
|
| 31 |
+
throw new Error("Missing required headers: x-scim-api-token or SCIM_API_TOKEN env");
|
| 32 |
}
|
| 33 |
|
| 34 |
if (!baseUrl) {
|
| 35 |
+
throw new Error("Missing required headers: x-scim-base-url or SCIM_API_BASE_URL env");
|
| 36 |
}
|
| 37 |
|
| 38 |
const { groupId } = params;
|
src/tools/deleteUser.ts
CHANGED
|
@@ -28,11 +28,11 @@ export default async function deleteUser(
|
|
| 28 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 29 |
|
| 30 |
if (!apiToken) {
|
| 31 |
-
throw new Error("Missing required headers: x-scim-api-token");
|
| 32 |
}
|
| 33 |
|
| 34 |
if (!baseUrl) {
|
| 35 |
-
throw new Error("Missing required headers: x-scim-base-url");
|
| 36 |
}
|
| 37 |
|
| 38 |
const { userId } = params;
|
|
|
|
| 28 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 29 |
|
| 30 |
if (!apiToken) {
|
| 31 |
+
throw new Error("Missing required headers: x-scim-api-token or SCIM_API_TOKEN env");
|
| 32 |
}
|
| 33 |
|
| 34 |
if (!baseUrl) {
|
| 35 |
+
throw new Error("Missing required headers: x-scim-base-url or SCIM_API_BASE_URL env");
|
| 36 |
}
|
| 37 |
|
| 38 |
const { userId } = params;
|
src/tools/patchGroup.ts
CHANGED
|
@@ -31,11 +31,11 @@ export default async function patchGroup(
|
|
| 31 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 32 |
|
| 33 |
if (!apiToken) {
|
| 34 |
-
throw new Error("Missing required headers: x-scim-api-token");
|
| 35 |
}
|
| 36 |
|
| 37 |
if (!baseUrl) {
|
| 38 |
-
throw new Error("Missing required headers: x-scim-base-url");
|
| 39 |
}
|
| 40 |
|
| 41 |
const { groupId, ...patchOperation } = params;
|
|
|
|
| 31 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 32 |
|
| 33 |
if (!apiToken) {
|
| 34 |
+
throw new Error("Missing required headers: x-scim-api-token or SCIM_API_TOKEN env");
|
| 35 |
}
|
| 36 |
|
| 37 |
if (!baseUrl) {
|
| 38 |
+
throw new Error("Missing required headers: x-scim-base-url or SCIM_API_BASE_URL env");
|
| 39 |
}
|
| 40 |
|
| 41 |
const { groupId, ...patchOperation } = params;
|
src/tools/patchUser.ts
CHANGED
|
@@ -31,11 +31,11 @@ export default async function patchUser(
|
|
| 31 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 32 |
|
| 33 |
if (!apiToken) {
|
| 34 |
-
throw new Error("Missing required headers: x-scim-api-token");
|
| 35 |
}
|
| 36 |
|
| 37 |
if (!baseUrl) {
|
| 38 |
-
throw new Error("Missing required headers: x-scim-base-url");
|
| 39 |
}
|
| 40 |
|
| 41 |
const { userId, ...patchOperation } = params;
|
|
|
|
| 31 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 32 |
|
| 33 |
if (!apiToken) {
|
| 34 |
+
throw new Error("Missing required headers: x-scim-api-token or SCIM_API_TOKEN env");
|
| 35 |
}
|
| 36 |
|
| 37 |
if (!baseUrl) {
|
| 38 |
+
throw new Error("Missing required headers: x-scim-base-url or SCIM_API_BASE_URL env");
|
| 39 |
}
|
| 40 |
|
| 41 |
const { userId, ...patchOperation } = params;
|
src/tools/removeUserFromGroup.ts
CHANGED
|
@@ -30,11 +30,11 @@ export default async function removeUserFromGroup(
|
|
| 30 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 31 |
|
| 32 |
if (!apiToken) {
|
| 33 |
-
throw new Error("Missing required headers: x-scim-api-token");
|
| 34 |
}
|
| 35 |
|
| 36 |
if (!baseUrl) {
|
| 37 |
-
throw new Error("Missing required headers: x-scim-base-url");
|
| 38 |
}
|
| 39 |
|
| 40 |
const { groupId, userId } = params;
|
|
|
|
| 30 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 31 |
|
| 32 |
if (!apiToken) {
|
| 33 |
+
throw new Error("Missing required headers: x-scim-api-token or SCIM_API_TOKEN env");
|
| 34 |
}
|
| 35 |
|
| 36 |
if (!baseUrl) {
|
| 37 |
+
throw new Error("Missing required headers: x-scim-base-url or SCIM_API_BASE_URL env");
|
| 38 |
}
|
| 39 |
|
| 40 |
const { groupId, userId } = params;
|
src/tools/replaceGroup.ts
CHANGED
|
@@ -31,11 +31,11 @@ export default async function replaceGroup(
|
|
| 31 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 32 |
|
| 33 |
if (!apiToken) {
|
| 34 |
-
throw new Error("Missing required headers: x-scim-api-token");
|
| 35 |
}
|
| 36 |
|
| 37 |
if (!baseUrl) {
|
| 38 |
-
throw new Error("Missing required headers: x-scim-base-url");
|
| 39 |
}
|
| 40 |
|
| 41 |
const { groupId, ...groupResource } = params;
|
|
|
|
| 31 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 32 |
|
| 33 |
if (!apiToken) {
|
| 34 |
+
throw new Error("Missing required headers: x-scim-api-token or SCIM_API_TOKEN env");
|
| 35 |
}
|
| 36 |
|
| 37 |
if (!baseUrl) {
|
| 38 |
+
throw new Error("Missing required headers: x-scim-base-url or SCIM_API_BASE_URL env");
|
| 39 |
}
|
| 40 |
|
| 41 |
const { groupId, ...groupResource } = params;
|
src/tools/replaceUser.ts
CHANGED
|
@@ -31,11 +31,11 @@ export default async function replaceUser(
|
|
| 31 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 32 |
|
| 33 |
if (!apiToken) {
|
| 34 |
-
throw new Error("Missing required headers: x-scim-api-token");
|
| 35 |
}
|
| 36 |
|
| 37 |
if (!baseUrl) {
|
| 38 |
-
throw new Error("Missing required headers: x-scim-base-url");
|
| 39 |
}
|
| 40 |
|
| 41 |
const { userId, ...userResource } = params;
|
|
|
|
| 31 |
const baseUrl = getScimBaseUrl(requestHeaders);
|
| 32 |
|
| 33 |
if (!apiToken) {
|
| 34 |
+
throw new Error("Missing required headers: x-scim-api-token or SCIM_API_TOKEN env");
|
| 35 |
}
|
| 36 |
|
| 37 |
if (!baseUrl) {
|
| 38 |
+
throw new Error("Missing required headers: x-scim-base-url or SCIM_API_BASE_URL env");
|
| 39 |
}
|
| 40 |
|
| 41 |
const { userId, ...userResource } = params;
|