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