akanjs 2.4.1-rc.0 → 2.4.1-rc.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akanjs",
3
- "version": "2.4.1-rc.0",
3
+ "version": "2.4.1-rc.2",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -117,11 +117,13 @@ export class SignalContext<
117
117
  async #checkGuards() {
118
118
  const guards = this.endpointInfo.signalOption.guards ?? [];
119
119
  if (guards.length === 0) return;
120
- for (const GuardCls of guards) {
121
- const guard = new GuardCls();
122
- const canPass = guard.canPass(this);
123
- if (!canPass) throw new Exception.Forbidden(`Access denied by guard: ${GuardCls.name}`);
124
- }
120
+ await Promise.all(
121
+ guards.map(async (GuardCls) => {
122
+ const guard = new GuardCls();
123
+ const canPass = await guard.canPass(this);
124
+ if (!canPass) throw new Exception.Forbidden(`Access denied by guard: ${GuardCls.name}`);
125
+ }),
126
+ );
125
127
  }
126
128
  async exec() {
127
129
  if (!this.trace) return await this.#exec();