@mastra/auth-workos 1.6.7-alpha.0 → 1.6.7

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/index.cjs CHANGED
@@ -357,7 +357,7 @@ function getWebRequest(request) {
357
357
  * Generated once per process to ensure consistency during dev.
358
358
  */
359
359
  const DEV_COOKIE_PASSWORD = crypto.randomUUID() + crypto.randomUUID();
360
- const MEMBERSHIP_CACHE_TTL_MS = 60 * 1e3;
360
+ const MEMBERSHIP_CACHE_TTL_MS = 6e4;
361
361
  const MEMBERSHIP_CACHE_MAX_SIZE = 1e3;
362
362
  /** Pull a stable error code out of a WorkOS SDK error, if present. */
363
363
  function workosErrorCode(error) {
@@ -438,7 +438,7 @@ var MastraAuthWorkos = class extends MastraAuthProvider {
438
438
  redirectUri,
439
439
  cookiePassword,
440
440
  cookieName: options?.session?.cookieName ?? "wos_session",
441
- cookieMaxAge: options?.session?.maxAge ?? 3600 * 24 * 400,
441
+ cookieMaxAge: options?.session?.maxAge ?? 3456e4,
442
442
  cookieSameSite: options?.session?.sameSite?.toLowerCase(),
443
443
  cookieDomain: void 0,
444
444
  apiHttps: true
@@ -473,7 +473,8 @@ var MastraAuthWorkos = class extends MastraAuthProvider {
473
473
  };
474
474
  }
475
475
  if (token) {
476
- const payload = await (0, _mastra_auth.verifyJwks)(token, this.workos.userManagement.getJwksUrl(this.clientId));
476
+ const jwksUri = this.workos.userManagement.getJwksUrl(this.clientId);
477
+ const payload = await (0, _mastra_auth.verifyJwks)(token, jwksUri);
477
478
  const jwtUser = this.resolveJwtPayloadUser(payload);
478
479
  if (this.trustJwtClaims && jwtUser?.id && jwtUser?.workosId) return await this.attachMembershipsIfNeeded(jwtUser);
479
480
  if (payload?.sub) try {
@@ -940,7 +941,7 @@ var MastraAuthWorkos = class extends MastraAuthProvider {
940
941
  }
941
942
  };
942
943
  //#endregion
943
- //#region ../../packages/_internals/auth/dist/ee-btY6vXIW.js
944
+ //#region ../../packages/_internals/auth/dist/ee-XRuijAiF.js
944
945
  /**
945
946
  * FGA enforcement utility for checking fine-grained authorization.
946
947
  *
@@ -1106,7 +1107,7 @@ function resolvePermissionsFromMapping(roles, mapping) {
1106
1107
  * ```
1107
1108
  */
1108
1109
  /** Default cache TTL in milliseconds (60 seconds) */
1109
- const DEFAULT_CACHE_TTL_MS = 60 * 1e3;
1110
+ const DEFAULT_CACHE_TTL_MS = 6e4;
1110
1111
  /** Default max cache size (number of users) */
1111
1112
  const DEFAULT_CACHE_MAX_SIZE = 1e3;
1112
1113
  var MastraRBACWorkos = class {