@better-auth/sso 1.4.0-beta.12 → 1.4.0-beta.14

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.
@@ -1,25 +1,25 @@
1
1
 
2
- > @better-auth/sso@1.4.0-beta.12 build /home/runner/work/better-auth/better-auth/packages/sso
2
+ > @better-auth/sso@1.4.0-beta.14 build /home/runner/work/better-auth/better-auth/packages/sso
3
3
  > tsdown
4
4
 
5
- ℹ tsdown v0.15.6 powered by rolldown v1.0.0-beta.43
5
+ ℹ tsdown v0.15.10 powered by rolldown v1.0.0-beta.44
6
6
  ℹ Using tsdown config: /home/runner/work/better-auth/better-auth/packages/sso/tsdown.config.ts
7
7
  ℹ entry: src/client.ts, src/index.ts
8
8
  ℹ tsconfig: tsconfig.json
9
9
  ℹ Build start
10
- ℹ [CJS] dist/client.cjs  0.19 kB │ gzip: 0.17 kB
10
+ ℹ [CJS] dist/client.cjs  0.19 kB │ gzip: 0.16 kB
11
11
  ℹ [CJS] dist/index.cjs  0.08 kB │ gzip: 0.08 kB
12
- ℹ [CJS] dist/src-BYOa9Nr6.cjs 52.34 kB │ gzip: 9.21 kB
12
+ ℹ [CJS] dist/src-BsLnNXTo.cjs 52.34 kB │ gzip: 9.21 kB
13
13
  ℹ [CJS] 3 files, total: 52.61 kB
14
14
  ℹ [ESM] dist/client.js  0.18 kB │ gzip: 0.16 kB
15
15
  ℹ [ESM] dist/index.js  0.06 kB │ gzip: 0.07 kB
16
- ℹ [ESM] dist/src-Z1RpfPZt.js 49.58 kB │ gzip: 8.54 kB
17
- ℹ [ESM] dist/index.d.ts  0.21 kB │ gzip: 0.12 kB
16
+ ℹ [ESM] dist/src-BEPbgggK.js 49.59 kB │ gzip: 8.54 kB
17
+ ℹ [ESM] dist/index.d.ts  0.24 kB │ gzip: 0.16 kB
18
18
  ℹ [ESM] dist/client.d.ts  0.21 kB │ gzip: 0.18 kB
19
- ℹ [ESM] dist/index-B2BVFq3k.d.ts 21.39 kB │ gzip: 3.08 kB
20
- ℹ [ESM] 6 files, total: 71.62 kB
21
- ℹ [CJS] dist/index.d.cts  0.21 kB │ gzip: 0.12 kB
19
+ ℹ [ESM] dist/index-CL9gq2xe.d.ts 21.42 kB │ gzip: 3.10 kB
20
+ ℹ [ESM] 6 files, total: 71.70 kB
21
+ ℹ [CJS] dist/index.d.cts  0.24 kB │ gzip: 0.16 kB
22
22
  ℹ [CJS] dist/client.d.cts  0.21 kB │ gzip: 0.18 kB
23
- ℹ [CJS] dist/index-ChbeAG7i.d.cts 21.39 kB │ gzip: 3.09 kB
24
- ℹ [CJS] 3 files, total: 21.80 kB
25
- ✔ Build complete in 5275ms
23
+ ℹ [CJS] dist/index-N2GvRGik.d.cts 21.42 kB │ gzip: 3.10 kB
24
+ ℹ [CJS] 3 files, total: 21.88 kB
25
+ ✔ Build complete in 8609ms
package/dist/client.cjs CHANGED
@@ -1,4 +1,4 @@
1
- require('./src-BYOa9Nr6.cjs');
1
+ require('./src-BsLnNXTo.cjs');
2
2
 
3
3
  //#region src/client.ts
4
4
  const ssoClient = () => {
package/dist/client.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { sso } from "./index-ChbeAG7i.cjs";
1
+ import { s as sso } from "./index-N2GvRGik.cjs";
2
2
 
3
3
  //#region src/client.d.ts
4
4
  declare const ssoClient: () => {
package/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { sso } from "./index-B2BVFq3k.js";
1
+ import { s as sso } from "./index-CL9gq2xe.js";
2
2
 
3
3
  //#region src/client.d.ts
4
4
  declare const ssoClient: () => {
package/dist/client.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./src-Z1RpfPZt.js";
1
+ import "./src-BEPbgggK.js";
2
2
 
3
3
  //#region src/client.ts
4
4
  const ssoClient = () => {
@@ -193,8 +193,8 @@ declare const sso: (options?: SSOOptions) => {
193
193
  query: z.ZodObject<{
194
194
  providerId: z.ZodString;
195
195
  format: z.ZodDefault<z.ZodEnum<{
196
- xml: "xml";
197
196
  json: "json";
197
+ xml: "xml";
198
198
  }>>;
199
199
  }, z.core.$strip>;
200
200
  metadata: {
@@ -685,4 +685,4 @@ declare const sso: (options?: SSOOptions) => {
685
685
  };
686
686
  };
687
687
  //#endregion
688
- export { OIDCConfig, OIDCMapping, SAMLConfig, SAMLMapping, SSOOptions, SSOProvider, sso };
688
+ export { SSOOptions as a, SAMLMapping as i, OIDCMapping as n, SSOProvider as o, SAMLConfig as r, sso as s, OIDCConfig as t };
@@ -193,8 +193,8 @@ declare const sso: (options?: SSOOptions) => {
193
193
  query: z.ZodObject<{
194
194
  providerId: z.ZodString;
195
195
  format: z.ZodDefault<z.ZodEnum<{
196
- xml: "xml";
197
196
  json: "json";
197
+ xml: "xml";
198
198
  }>>;
199
199
  }, z.core.$strip>;
200
200
  metadata: {
@@ -685,4 +685,4 @@ declare const sso: (options?: SSOOptions) => {
685
685
  };
686
686
  };
687
687
  //#endregion
688
- export { OIDCConfig, OIDCMapping, SAMLConfig, SAMLMapping, SSOOptions, SSOProvider, sso };
688
+ export { SSOOptions as a, SAMLMapping as i, OIDCMapping as n, SSOProvider as o, SAMLConfig as r, sso as s, OIDCConfig as t };
package/dist/index.cjs CHANGED
@@ -1,3 +1,3 @@
1
- const require_src = require('./src-BYOa9Nr6.cjs');
1
+ const require_src = require('./src-BsLnNXTo.cjs');
2
2
 
3
3
  exports.sso = require_src.sso;
package/dist/index.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { OIDCConfig, OIDCMapping, SAMLConfig, SAMLMapping, SSOOptions, SSOProvider, sso } from "./index-ChbeAG7i.cjs";
1
+ import { a as SSOOptions, i as SAMLMapping, n as OIDCMapping, o as SSOProvider, r as SAMLConfig, s as sso, t as OIDCConfig } from "./index-N2GvRGik.cjs";
2
2
  export { OIDCConfig, OIDCMapping, SAMLConfig, SAMLMapping, SSOOptions, SSOProvider, sso };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { OIDCConfig, OIDCMapping, SAMLConfig, SAMLMapping, SSOOptions, SSOProvider, sso } from "./index-B2BVFq3k.js";
1
+ import { a as SSOOptions, i as SAMLMapping, n as OIDCMapping, o as SSOProvider, r as SAMLConfig, s as sso, t as OIDCConfig } from "./index-CL9gq2xe.js";
2
2
  export { OIDCConfig, OIDCMapping, SAMLConfig, SAMLMapping, SSOOptions, SSOProvider, sso };
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { sso } from "./src-Z1RpfPZt.js";
1
+ import { t as sso } from "./src-BEPbgggK.js";
2
2
 
3
3
  export { sso };
@@ -1,13 +1,13 @@
1
+ import { BetterFetchError, betterFetch } from "@better-fetch/fetch";
1
2
  import { generateState } from "better-auth";
2
3
  import { APIError, sessionMiddleware } from "better-auth/api";
4
+ import { setSessionCookie } from "better-auth/cookies";
3
5
  import { createAuthorizationURL, handleOAuthUserInfo, parseState, validateAuthorizationCode, validateToken } from "better-auth/oauth2";
4
6
  import { createAuthEndpoint } from "better-auth/plugins";
5
- import * as z from "zod/v4";
6
- import * as saml from "samlify";
7
- import { BetterFetchError, betterFetch } from "@better-fetch/fetch";
8
- import { decodeJwt } from "jose";
9
- import { setSessionCookie } from "better-auth/cookies";
10
7
  import { XMLValidator } from "fast-xml-parser";
8
+ import { decodeJwt } from "jose";
9
+ import * as saml from "samlify";
10
+ import * as z from "zod/v4";
11
11
 
12
12
  //#region src/index.ts
13
13
  saml.setSchemaValidator({ async validate(xml) {
@@ -1215,4 +1215,4 @@ const sso = (options) => {
1215
1215
  };
1216
1216
 
1217
1217
  //#endregion
1218
- export { sso };
1218
+ export { sso as t };
@@ -21,26 +21,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  }) : target, mod));
22
22
 
23
23
  //#endregion
24
+ let __better_fetch_fetch = require("@better-fetch/fetch");
25
+ __better_fetch_fetch = __toESM(__better_fetch_fetch);
24
26
  let better_auth = require("better-auth");
25
27
  better_auth = __toESM(better_auth);
26
28
  let better_auth_api = require("better-auth/api");
27
29
  better_auth_api = __toESM(better_auth_api);
30
+ let better_auth_cookies = require("better-auth/cookies");
31
+ better_auth_cookies = __toESM(better_auth_cookies);
28
32
  let better_auth_oauth2 = require("better-auth/oauth2");
29
33
  better_auth_oauth2 = __toESM(better_auth_oauth2);
30
34
  let better_auth_plugins = require("better-auth/plugins");
31
35
  better_auth_plugins = __toESM(better_auth_plugins);
32
- let zod_v4 = require("zod/v4");
33
- zod_v4 = __toESM(zod_v4);
34
- let samlify = require("samlify");
35
- samlify = __toESM(samlify);
36
- let __better_fetch_fetch = require("@better-fetch/fetch");
37
- __better_fetch_fetch = __toESM(__better_fetch_fetch);
38
- let jose = require("jose");
39
- jose = __toESM(jose);
40
- let better_auth_cookies = require("better-auth/cookies");
41
- better_auth_cookies = __toESM(better_auth_cookies);
42
36
  let fast_xml_parser = require("fast-xml-parser");
43
37
  fast_xml_parser = __toESM(fast_xml_parser);
38
+ let jose = require("jose");
39
+ jose = __toESM(jose);
40
+ let samlify = require("samlify");
41
+ samlify = __toESM(samlify);
42
+ let zod_v4 = require("zod/v4");
43
+ zod_v4 = __toESM(zod_v4);
44
44
 
45
45
  //#region src/index.ts
46
46
  samlify.setSchemaValidator({ async validate(xml) {
package/package.json CHANGED
@@ -1,9 +1,15 @@
1
1
  {
2
2
  "name": "@better-auth/sso",
3
3
  "author": "Bereket Engida",
4
- "version": "1.4.0-beta.12",
4
+ "version": "1.4.0-beta.14",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
+ "homepage": "https://www.better-auth.com/docs/plugins/sso",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/better-auth/better-auth",
11
+ "directory": "packages/sso"
12
+ },
7
13
  "license": "MIT",
8
14
  "keywords": [
9
15
  "sso",
@@ -24,11 +30,13 @@
24
30
  "description": "SSO plugin for Better Auth",
25
31
  "exports": {
26
32
  ".": {
33
+ "better-auth-dev-source": "./src/index.ts",
27
34
  "types": "./dist/index.d.ts",
28
35
  "import": "./dist/index.js",
29
36
  "require": "./dist/index.cjs"
30
37
  },
31
38
  "./client": {
39
+ "better-auth-dev-source": "./src/client.ts",
32
40
  "types": "./dist/client.d.ts",
33
41
  "import": "./dist/client.js",
34
42
  "require": "./dist/client.cjs"
@@ -58,11 +66,11 @@
58
66
  "better-call": "1.0.24",
59
67
  "body-parser": "^2.2.0",
60
68
  "express": "^5.1.0",
61
- "tsdown": "^0.15.6",
62
- "better-auth": "^1.4.0-beta.12"
69
+ "tsdown": "^0.15.10",
70
+ "better-auth": "^1.4.0-beta.14"
63
71
  },
64
72
  "peerDependencies": {
65
- "better-auth": "1.4.0-beta.12"
73
+ "better-auth": "1.4.0-beta.14"
66
74
  },
67
75
  "scripts": {
68
76
  "test": "vitest",
package/src/index.ts CHANGED
@@ -1,12 +1,14 @@
1
+ import { BetterFetchError, betterFetch } from "@better-fetch/fetch";
1
2
  import {
2
- generateState,
3
3
  type Account,
4
4
  type BetterAuthPlugin,
5
+ generateState,
5
6
  type OAuth2Tokens,
6
7
  type Session,
7
8
  type User,
8
9
  } from "better-auth";
9
10
  import { APIError, sessionMiddleware } from "better-auth/api";
11
+ import { setSessionCookie } from "better-auth/cookies";
10
12
  import {
11
13
  createAuthorizationURL,
12
14
  handleOAuthUserInfo,
@@ -14,17 +16,14 @@ import {
14
16
  validateAuthorizationCode,
15
17
  validateToken,
16
18
  } from "better-auth/oauth2";
17
-
18
19
  import { createAuthEndpoint } from "better-auth/plugins";
19
- import * as z from "zod/v4";
20
+ import { XMLValidator } from "fast-xml-parser";
21
+ import { decodeJwt } from "jose";
20
22
  import * as saml from "samlify";
21
23
  import type { BindingContext } from "samlify/types/src/entity";
22
- import { betterFetch, BetterFetchError } from "@better-fetch/fetch";
23
- import { decodeJwt } from "jose";
24
- import { setSessionCookie } from "better-auth/cookies";
25
- import type { FlowResult } from "samlify/types/src/flow";
26
- import { XMLValidator } from "fast-xml-parser";
27
24
  import type { IdentityProvider } from "samlify/types/src/entity-idp";
25
+ import type { FlowResult } from "samlify/types/src/flow";
26
+ import * as z from "zod/v4";
28
27
 
29
28
  const fastValidator = {
30
29
  async validate(xml: string) {
package/src/oidc.test.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { afterAll, beforeAll, describe, expect, it } from "vitest";
2
- import { getTestInstanceMemory as getTestInstance } from "better-auth/test";
3
- import { sso } from ".";
4
- import { OAuth2Server } from "oauth2-mock-server";
5
1
  import { betterFetch } from "@better-fetch/fetch";
6
- import { organization } from "better-auth/plugins";
7
2
  import { createAuthClient } from "better-auth/client";
3
+ import { organization } from "better-auth/plugins";
4
+ import { getTestInstanceMemory as getTestInstance } from "better-auth/test";
5
+ import { OAuth2Server } from "oauth2-mock-server";
6
+ import { afterAll, beforeAll, describe, expect, it } from "vitest";
7
+ import { sso } from ".";
8
8
  import { ssoClient } from "./client";
9
9
 
10
10
  let server = new OAuth2Server();
package/src/saml.test.ts CHANGED
@@ -1,31 +1,31 @@
1
- import {
2
- afterAll,
3
- beforeAll,
4
- beforeEach,
5
- describe,
6
- expect,
7
- it,
8
- vi,
9
- } from "vitest";
1
+ import { betterFetch } from "@better-fetch/fetch";
10
2
  import { betterAuth } from "better-auth";
11
3
  import { memoryAdapter } from "better-auth/adapters/memory";
12
4
  import { createAuthClient } from "better-auth/client";
13
- import { betterFetch } from "@better-fetch/fetch";
14
5
  import { setCookieToHeader } from "better-auth/cookies";
15
6
  import { bearer } from "better-auth/plugins";
16
- import { sso } from ".";
17
- import { ssoClient } from "./client";
18
- import { createServer } from "http";
19
- import * as saml from "samlify";
7
+ import { getTestInstanceMemory } from "better-auth/test";
8
+ import bodyParser from "body-parser";
9
+ import { randomUUID } from "crypto";
20
10
  import type {
21
11
  Application as ExpressApp,
22
12
  Request as ExpressRequest,
23
13
  Response as ExpressResponse,
24
14
  } from "express";
25
15
  import express from "express";
26
- import bodyParser from "body-parser";
27
- import { randomUUID } from "crypto";
28
- import { getTestInstanceMemory } from "better-auth/test";
16
+ import { createServer } from "http";
17
+ import * as saml from "samlify";
18
+ import {
19
+ afterAll,
20
+ beforeAll,
21
+ beforeEach,
22
+ describe,
23
+ expect,
24
+ it,
25
+ vi,
26
+ } from "vitest";
27
+ import { sso } from ".";
28
+ import { ssoClient } from "./client";
29
29
 
30
30
  const spMetadata = `
31
31
  <md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" entityID="http://localhost:3001/api/sso/saml2/sp/metadata">
package/tsconfig.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
- "extends": "../../tsconfig.json",
2
+ "extends": "../../tsconfig.base.json",
3
3
  "compilerOptions": {
4
- "rootDir": "./src",
5
- "outDir": "./dist",
6
4
  "lib": ["esnext", "dom", "dom.iterable"]
7
5
  },
8
- "include": ["src"]
6
+ "references": [
7
+ {
8
+ "path": "../better-auth/tsconfig.json"
9
+ }
10
+ ]
9
11
  }
package/tsdown.config.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { defineConfig } from "tsdown";
2
2
 
3
3
  export default defineConfig({
4
- dts: true,
4
+ dts: { build: true, incremental: true },
5
5
  format: ["esm", "cjs"],
6
6
  entry: ["./src/index.ts", "./src/client.ts"],
7
7
  external: ["better-auth", "better-call", "@better-fetch/fetch", "stripe"],