@better-auth/sso 1.6.14 → 1.6.15

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-ekzjMTDh.mjs";
1
+ import { t as PACKAGE_VERSION } from "./version-BPpah8cV.mjs";
2
2
  //#region src/client.ts
3
3
  const ssoClient = (options) => {
4
4
  return {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PACKAGE_VERSION } from "./version-ekzjMTDh.mjs";
1
+ import { t as PACKAGE_VERSION } from "./version-BPpah8cV.mjs";
2
2
  import { APIError, createAuthEndpoint, createAuthMiddleware, getSessionFromCtx, sessionMiddleware } from "better-auth/api";
3
3
  import { XMLParser, XMLValidator } from "fast-xml-parser";
4
4
  import { X509Certificate } from "node:crypto";
@@ -1538,7 +1538,8 @@ function createSP(config, baseURL, providerId, opts) {
1538
1538
  encPrivateKey: normalizePem(spData?.encPrivateKey),
1539
1539
  encPrivateKeyPass: spData?.encPrivateKeyPass,
1540
1540
  nameIDFormat: config.identifierFormat ? [config.identifierFormat] : void 0,
1541
- relayState: opts?.relayState
1541
+ relayState: opts?.relayState,
1542
+ clockDrifts: opts?.clockSkew && opts?.clockSkew !== 0 ? [-opts.clockSkew, opts.clockSkew] : void 0
1542
1543
  });
1543
1544
  }
1544
1545
  function createIdP(config) {
@@ -1694,7 +1695,7 @@ async function processSAMLResponse(ctx, params, options) {
1694
1695
  if (options?.domainVerification?.enabled && !("domainVerified" in provider && provider.domainVerified)) throw new APIError("UNAUTHORIZED", { message: "Provider domain has not been verified" });
1695
1696
  const parsedSamlConfig = typeof provider.samlConfig === "object" ? provider.samlConfig : safeJsonParse(provider.samlConfig);
1696
1697
  if (!parsedSamlConfig) throw new APIError("BAD_REQUEST", { message: "Invalid SAML configuration" });
1697
- const sp = createSP(parsedSamlConfig, ctx.context.baseURL, providerId);
1698
+ const sp = createSP(parsedSamlConfig, ctx.context.baseURL, providerId, { clockSkew: options?.saml?.clockSkew });
1698
1699
  const idp = createIdP(parsedSamlConfig);
1699
1700
  const samlRedirectUrl = getSafeRedirectUrl(relayState?.callbackURL || parsedSamlConfig.callbackUrl, params.currentCallbackPath, appOrigin, (url, settings) => ctx.context.isTrustedOrigin(url, settings));
1700
1701
  validateSingleAssertion(SAMLResponse);
@@ -1,5 +1,5 @@
1
1
  //#endregion
2
2
  //#region src/version.ts
3
- const PACKAGE_VERSION = "1.6.14";
3
+ const PACKAGE_VERSION = "1.6.15";
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/sso",
3
- "version": "1.6.14",
3
+ "version": "1.6.15",
4
4
  "description": "SSO plugin for Better Auth",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -70,15 +70,15 @@
70
70
  "express": "^5.2.1",
71
71
  "oauth2-mock-server": "^8.2.2",
72
72
  "tsdown": "0.21.1",
73
- "@better-auth/core": "1.6.14",
74
- "better-auth": "1.6.14"
73
+ "@better-auth/core": "1.6.15",
74
+ "better-auth": "1.6.15"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "@better-auth/utils": "0.4.1",
78
78
  "@better-fetch/fetch": "1.1.21",
79
79
  "better-call": "1.3.5",
80
- "@better-auth/core": "^1.6.14",
81
- "better-auth": "^1.6.14"
80
+ "@better-auth/core": "^1.6.15",
81
+ "better-auth": "^1.6.15"
82
82
  },
83
83
  "scripts": {
84
84
  "build": "tsdown",