@better-auth/scim 1.6.9 → 1.6.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PACKAGE_VERSION } from "./version-BI7AiK6S.mjs";
1
+ import { t as PACKAGE_VERSION } from "./version-D_ggtAOl.mjs";
2
2
  //#region src/client.ts
3
3
  const scimClient = () => {
4
4
  return {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PACKAGE_VERSION } from "./version-BI7AiK6S.mjs";
1
+ import { t as PACKAGE_VERSION } from "./version-D_ggtAOl.mjs";
2
2
  import { base64Url } from "@better-auth/utils/base64";
3
3
  import { APIError, createAuthEndpoint, createAuthMiddleware, sessionMiddleware } from "better-auth/api";
4
4
  import { APIError as APIError$1, HIDE_METADATA } from "better-auth";
@@ -700,6 +700,15 @@ const generateSCIMToken = (opts) => createAuthEndpoint("/scim/generate-token", {
700
700
  const user = ctx.context.session.user;
701
701
  const requiredRole = resolveRequiredRoles(ctx, opts);
702
702
  if (providerId.includes(":")) throw new APIError("BAD_REQUEST", { message: "Provider id contains forbidden characters" });
703
+ if (new Set([
704
+ "credential",
705
+ "email-otp",
706
+ "magic-link",
707
+ "phone-number",
708
+ "anonymous",
709
+ "siwe",
710
+ ...Object.keys(ctx.context.options.socialProviders ?? {})
711
+ ]).has(providerId)) throw new APIError("BAD_REQUEST", { message: "Provider id collides with a built-in account provider and cannot be used for SCIM" });
703
712
  if (organizationId && !ctx.context.hasPlugin("organization")) throw new APIError("BAD_REQUEST", { message: "Restricting a token to an organization requires the organization plugin" });
704
713
  let member = null;
705
714
  if (organizationId) {
@@ -1198,6 +1207,7 @@ const deleteSCIMUser = (authMiddleware) => createAuthEndpoint("/scim/v2/Users/:u
1198
1207
  organizationId
1199
1208
  });
1200
1209
  if (!user) throw new SCIMAPIError("NOT_FOUND", { detail: "User not found" });
1210
+ await ctx.context.internalAdapter.deleteSessions(userId);
1201
1211
  await ctx.context.internalAdapter.deleteUser(userId);
1202
1212
  ctx.setStatus(204);
1203
1213
  });
@@ -1,5 +1,5 @@
1
1
  //#endregion
2
2
  //#region src/version.ts
3
- const PACKAGE_VERSION = "1.6.9";
3
+ const PACKAGE_VERSION = "1.6.11";
4
4
  //#endregion
5
5
  export { PACKAGE_VERSION as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/scim",
3
- "version": "1.6.9",
3
+ "version": "1.6.11",
4
4
  "description": "SCIM plugin for Better Auth",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -54,14 +54,14 @@
54
54
  },
55
55
  "devDependencies": {
56
56
  "tsdown": "0.21.1",
57
- "@better-auth/core": "1.6.9",
58
- "@better-auth/sso": "1.6.9"
57
+ "@better-auth/core": "1.6.11",
58
+ "@better-auth/sso": "1.6.11"
59
59
  },
60
60
  "peerDependencies": {
61
61
  "@better-auth/utils": "0.4.0",
62
62
  "better-call": "1.3.5",
63
- "@better-auth/core": "^1.6.9",
64
- "better-auth": "^1.6.9"
63
+ "@better-auth/core": "^1.6.11",
64
+ "better-auth": "^1.6.11"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "tsdown",