@mastra/auth-workos 1.6.5 → 1.6.6-alpha.0

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.js CHANGED
@@ -459,13 +459,15 @@ var MastraAuthWorkos = class extends MastraAuthProvider {
459
459
  const { auth } = webRequest ? await this.authService.withAuth(webRequest) : { auth: { user: null } };
460
460
  if (auth.user) {
461
461
  let memberships;
462
+ let organizationId = auth.organizationId;
462
463
  if (this.fetchMemberships) try {
463
464
  memberships = await this.getMemberships(auth.user.id);
465
+ organizationId ??= this.getSingleMembershipOrganizationId(memberships);
464
466
  } catch {}
465
467
  return {
466
468
  ...mapWorkOSUserToEEUser(auth.user),
467
469
  workosId: auth.user.id,
468
- organizationId: auth.organizationId,
470
+ organizationId,
469
471
  memberships
470
472
  };
471
473
  }
@@ -937,7 +939,7 @@ var MastraAuthWorkos = class extends MastraAuthProvider {
937
939
  }
938
940
  };
939
941
  //#endregion
940
- //#region ../../packages/_internals/auth/dist/ee-DXvSoTl7.js
942
+ //#region ../../packages/_internals/auth/dist/ee-btY6vXIW.js
941
943
  /**
942
944
  * FGA enforcement utility for checking fine-grained authorization.
943
945
  *
@@ -973,6 +975,7 @@ const RESOURCE_EXPANSIONS = { stored: [
973
975
  "stored-prompt-blocks",
974
976
  "stored-scorers",
975
977
  "stored-skills",
978
+ "stored-workflows",
976
979
  "stored-workspaces"
977
980
  ] };
978
981
  /**