@better-auth/sso 1.5.0-beta.10 → 1.5.0-beta.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @better-auth/sso@1.5.0-beta.10 build /home/runner/work/better-auth/better-auth/packages/sso
2
+ > @better-auth/sso@1.5.0-beta.11 build /home/runner/work/better-auth/better-auth/packages/sso
3
3
  > tsdown
4
4
 
5
5
  ℹ tsdown v0.20.1 powered by rolldown v1.0.0-rc.1
@@ -7,14 +7,14 @@
7
7
  ℹ entry: src/index.ts, src/client.ts
8
8
  ℹ tsconfig: tsconfig.json
9
9
  ℹ Build start
10
- ℹ dist/index.mjs 120.85 kB │ gzip: 24.06 kB
10
+ ℹ dist/index.mjs 120.79 kB │ gzip: 24.04 kB
11
11
  ℹ dist/client.mjs  0.28 kB │ gzip: 0.21 kB
12
- ℹ dist/index.mjs.map 244.11 kB │ gzip: 46.78 kB
12
+ ℹ dist/index.mjs.map 244.10 kB │ gzip: 46.76 kB
13
13
  ℹ dist/client.mjs.map  0.94 kB │ gzip: 0.50 kB
14
+ [PLUGIN_TIMINGS] Warning: Your build spent significant time in plugin `rolldown-plugin-dts:generate`. See https://rolldown.rs/options/checks#plugintimings for more details.
14
15
  ℹ dist/index.d.mts  1.67 kB │ gzip: 0.57 kB
15
16
  ℹ dist/client.d.mts  0.62 kB │ gzip: 0.36 kB
16
- ℹ dist/index-CBBJTszO.d.mts  56.16 kB │ gzip: 9.96 kB
17
- ℹ 7 files, total: 424.63 kB
18
- [PLUGIN_TIMINGS] Warning: Your build spent significant time in plugin `rolldown-plugin-dts:generate`. See https://rolldown.rs/options/checks#plugintimings for more details.
17
+ ℹ dist/index-Bg_GWJqf.d.mts  56.30 kB │ gzip: 9.97 kB
18
+ ℹ 7 files, total: 424.70 kB
19
19
 
20
- ✔ Build complete in 26757ms
20
+ ✔ Build complete in 25650ms
package/dist/client.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as SSOPlugin } from "./index-CBBJTszO.mjs";
1
+ import { t as SSOPlugin } from "./index-Bg_GWJqf.mjs";
2
2
 
3
3
  //#region src/client.d.ts
4
4
  interface SSOClientOptions {
@@ -424,7 +424,7 @@ declare const requestDomainVerification: (options: SSOOptions) => better_call0.S
424
424
  updatedAt: Date;
425
425
  email: string;
426
426
  emailVerified: boolean;
427
- name: string;
427
+ name?: string | null | undefined;
428
428
  image?: string | null | undefined;
429
429
  };
430
430
  };
@@ -475,7 +475,7 @@ declare const verifyDomain: (options: SSOOptions) => better_call0.StrictEndpoint
475
475
  updatedAt: Date;
476
476
  email: string;
477
477
  emailVerified: boolean;
478
- name: string;
478
+ name?: string | null | undefined;
479
479
  image?: string | null | undefined;
480
480
  };
481
481
  };
@@ -503,7 +503,7 @@ declare const listSSOProviders: () => better_call0.StrictEndpoint<"/sso/provider
503
503
  updatedAt: Date;
504
504
  email: string;
505
505
  emailVerified: boolean;
506
- name: string;
506
+ name?: string | null | undefined;
507
507
  image?: string | null | undefined;
508
508
  };
509
509
  };
@@ -580,7 +580,7 @@ declare const getSSOProvider: () => better_call0.StrictEndpoint<"/sso/providers/
580
580
  updatedAt: Date;
581
581
  email: string;
582
582
  emailVerified: boolean;
583
- name: string;
583
+ name?: string | null | undefined;
584
584
  image?: string | null | undefined;
585
585
  };
586
586
  };
@@ -664,7 +664,7 @@ declare const updateSSOProvider: (options: SSOOptions) => better_call0.StrictEnd
664
664
  updatedAt: Date;
665
665
  email: string;
666
666
  emailVerified: boolean;
667
- name: string;
667
+ name?: string | null | undefined;
668
668
  image?: string | null | undefined;
669
669
  };
670
670
  };
@@ -823,7 +823,7 @@ declare const deleteSSOProvider: () => better_call0.StrictEndpoint<"/sso/provide
823
823
  updatedAt: Date;
824
824
  email: string;
825
825
  emailVerified: boolean;
826
- name: string;
826
+ name?: string | null | undefined;
827
827
  image?: string | null | undefined;
828
828
  };
829
829
  };
@@ -877,8 +877,8 @@ declare const spMetadata: () => better_call0.StrictEndpoint<"/sso/saml2/sp/metad
877
877
  query: z.ZodObject<{
878
878
  providerId: z.ZodString;
879
879
  format: z.ZodDefault<z.ZodEnum<{
880
- xml: "xml";
881
880
  json: "json";
881
+ xml: "xml";
882
882
  }>>;
883
883
  }, z.core.$strip>;
884
884
  metadata: {
@@ -992,7 +992,7 @@ declare const registerSSOProvider: <O extends SSOOptions>(options: O) => better_
992
992
  updatedAt: Date;
993
993
  email: string;
994
994
  emailVerified: boolean;
995
- name: string;
995
+ name?: string | null | undefined;
996
996
  image?: string | null | undefined;
997
997
  };
998
998
  };
@@ -1660,4 +1660,4 @@ declare function sso<O extends SSOOptions>(options?: O | undefined): {
1660
1660
  };
1661
1661
  //#endregion
1662
1662
  export { DataEncryptionAlgorithm as A, TimestampValidationOptions as C, SSOOptions as D, SAMLConfig as E, DigestAlgorithm as M, KeyEncryptionAlgorithm as N, SSOProvider as O, SignatureAlgorithm as P, SAMLConditions as S, OIDCConfig as T, REQUIRED_DISCOVERY_FIELDS as _, fetchDiscoveryDocument as a, DEFAULT_MAX_SAML_METADATA_SIZE as b, normalizeUrl as c, validateDiscoveryUrl as d, DiscoverOIDCConfigParams as f, OIDCDiscoveryDocument as g, HydratedOIDCConfig as h, discoverOIDCConfig as i, DeprecatedAlgorithmBehavior as j, AlgorithmValidationOptions as k, selectTokenEndpointAuthMethod as l, DiscoveryErrorCode as m, sso as n, needsRuntimeDiscovery as o, DiscoveryError as p, computeDiscoveryUrl as r, normalizeDiscoveryUrls as s, SSOPlugin as t, validateDiscoveryDocument as u, RequiredDiscoveryField as v, validateSAMLTimestamp as w, DEFAULT_MAX_SAML_RESPONSE_SIZE as x, DEFAULT_CLOCK_SKEW_MS as y };
1663
- //# sourceMappingURL=index-CBBJTszO.d.mts.map
1663
+ //# sourceMappingURL=index-Bg_GWJqf.d.mts.map
package/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as DataEncryptionAlgorithm, C as TimestampValidationOptions, D as SSOOptions, E as SAMLConfig, M as DigestAlgorithm, N as KeyEncryptionAlgorithm, O as SSOProvider, P as SignatureAlgorithm, S as SAMLConditions, T as OIDCConfig, _ as REQUIRED_DISCOVERY_FIELDS, a as fetchDiscoveryDocument, b as DEFAULT_MAX_SAML_METADATA_SIZE, c as normalizeUrl, d as validateDiscoveryUrl, f as DiscoverOIDCConfigParams, g as OIDCDiscoveryDocument, h as HydratedOIDCConfig, i as discoverOIDCConfig, j as DeprecatedAlgorithmBehavior, k as AlgorithmValidationOptions, l as selectTokenEndpointAuthMethod, m as DiscoveryErrorCode, n as sso, o as needsRuntimeDiscovery, p as DiscoveryError, r as computeDiscoveryUrl, s as normalizeDiscoveryUrls, t as SSOPlugin, u as validateDiscoveryDocument, v as RequiredDiscoveryField, w as validateSAMLTimestamp, x as DEFAULT_MAX_SAML_RESPONSE_SIZE, y as DEFAULT_CLOCK_SKEW_MS } from "./index-CBBJTszO.mjs";
1
+ import { A as DataEncryptionAlgorithm, C as TimestampValidationOptions, D as SSOOptions, E as SAMLConfig, M as DigestAlgorithm, N as KeyEncryptionAlgorithm, O as SSOProvider, P as SignatureAlgorithm, S as SAMLConditions, T as OIDCConfig, _ as REQUIRED_DISCOVERY_FIELDS, a as fetchDiscoveryDocument, b as DEFAULT_MAX_SAML_METADATA_SIZE, c as normalizeUrl, d as validateDiscoveryUrl, f as DiscoverOIDCConfigParams, g as OIDCDiscoveryDocument, h as HydratedOIDCConfig, i as discoverOIDCConfig, j as DeprecatedAlgorithmBehavior, k as AlgorithmValidationOptions, l as selectTokenEndpointAuthMethod, m as DiscoveryErrorCode, n as sso, o as needsRuntimeDiscovery, p as DiscoveryError, r as computeDiscoveryUrl, s as normalizeDiscoveryUrls, t as SSOPlugin, u as validateDiscoveryDocument, v as RequiredDiscoveryField, w as validateSAMLTimestamp, x as DEFAULT_MAX_SAML_RESPONSE_SIZE, y as DEFAULT_CLOCK_SKEW_MS } from "./index-Bg_GWJqf.mjs";
2
2
  export { AlgorithmValidationOptions, DEFAULT_CLOCK_SKEW_MS, DEFAULT_MAX_SAML_METADATA_SIZE, DEFAULT_MAX_SAML_RESPONSE_SIZE, DataEncryptionAlgorithm, DeprecatedAlgorithmBehavior, DigestAlgorithm, DiscoverOIDCConfigParams, DiscoveryError, DiscoveryErrorCode, HydratedOIDCConfig, KeyEncryptionAlgorithm, OIDCConfig, OIDCDiscoveryDocument, REQUIRED_DISCOVERY_FIELDS, RequiredDiscoveryField, SAMLConditions, SAMLConfig, SSOOptions, SSOPlugin, SSOProvider, SignatureAlgorithm, TimestampValidationOptions, computeDiscoveryUrl, discoverOIDCConfig, fetchDiscoveryDocument, needsRuntimeDiscovery, normalizeDiscoveryUrls, normalizeUrl, selectTokenEndpointAuthMethod, sso, validateDiscoveryDocument, validateDiscoveryUrl, validateSAMLTimestamp };
package/dist/index.mjs CHANGED
@@ -11,7 +11,6 @@ import { HIDE_METADATA, createAuthorizationURL, generateGenericState, generateSt
11
11
  import { setSessionCookie } from "better-auth/cookies";
12
12
  import { handleOAuthUserInfo } from "better-auth/oauth2";
13
13
  import { decodeJwt } from "jose";
14
- import { APIError as APIError$1 } from "better-call";
15
14
 
16
15
  //#region src/utils.ts
17
16
  /**
@@ -1360,7 +1359,7 @@ function mapDiscoveryErrorToAPIError(error) {
1360
1359
  //#region src/saml-state.ts
1361
1360
  async function generateRelayState(c, link, additionalData) {
1362
1361
  const callbackURL = c.body.callbackURL;
1363
- if (!callbackURL) throw new APIError$1("BAD_REQUEST", { message: "callbackURL is required" });
1362
+ if (!callbackURL) throw new APIError("BAD_REQUEST", { message: "callbackURL is required" });
1364
1363
  const codeVerifier = generateRandomString(128);
1365
1364
  const stateData = {
1366
1365
  ...additionalData ? additionalData : {},
@@ -1376,7 +1375,7 @@ async function generateRelayState(c, link, additionalData) {
1376
1375
  return generateGenericState(c, stateData, { cookieName: "relay_state" });
1377
1376
  } catch (error) {
1378
1377
  c.context.logger.error("Failed to create verification for relay state", error);
1379
- throw new APIError$1("INTERNAL_SERVER_ERROR", {
1378
+ throw new APIError("INTERNAL_SERVER_ERROR", {
1380
1379
  message: "State error: Unable to create verification for relay state",
1381
1380
  cause: error
1382
1381
  });
@@ -1390,7 +1389,7 @@ async function parseRelayState(c) {
1390
1389
  parsedData = await parseGenericState(c, state, { cookieName: "relay_state" });
1391
1390
  } catch (error) {
1392
1391
  c.context.logger.error("Failed to parse relay state", error);
1393
- throw new APIError$1("BAD_REQUEST", {
1392
+ throw new APIError("BAD_REQUEST", {
1394
1393
  message: "State error: failed to validate relay state",
1395
1394
  cause: error
1396
1395
  });