@absolutejs/auth 0.56.10 → 0.56.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.
package/dist/server.js CHANGED
@@ -30248,11 +30248,12 @@ var delegateAgentAuthorization = async (agentAuth, context, auditEmit) => {
30248
30248
  now,
30249
30249
  userId: context.userSub
30250
30250
  });
30251
+ const grantedScopes2 = context.scopes.filter((scope) => registration2.allowedScopes.includes(scope) && agentAuth.scopes.includes(scope));
30251
30252
  await agentAuth.delegationStore.saveDelegation({
30252
30253
  agentId: registration2.agentId,
30253
30254
  createdAt: existing?.createdAt ?? now,
30254
30255
  delegationId: existing?.delegationId ?? `agd_${crypto.randomUUID()}`,
30255
- scopes: context.scopes.filter((scope) => registration2.allowedScopes.includes(scope) && agentAuth.scopes.includes(scope)),
30256
+ scopes: [...new Set([...existing?.scopes ?? [], ...grantedScopes2])],
30256
30257
  status: "active",
30257
30258
  updatedAt: now,
30258
30259
  userId: context.userSub
@@ -30586,5 +30587,5 @@ export {
30586
30587
  auth2 as auth
30587
30588
  };
30588
30589
 
30589
- //# debugId=286B6E54F8CE0D4D64756E2164756E21
30590
+ //# debugId=DC157A619FC3907564756E2164756E21
30590
30591
  //# sourceMappingURL=server.js.map