Skip to content

Commit ce93256

Browse files
authored
fix: remove incorrect authorization stage (#279)
1 parent 80d84d3 commit ce93256

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

packages/federation-sdk/src/services/staging-area.service.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,6 @@ export class StagingAreaService {
124124
throw new MissingEventsError('Added missing events');
125125
}
126126

127-
if ('from' in event && event.from !== 'join') {
128-
await this.processAuthorizationStage(event);
129-
}
130127
await this.stateService.handlePdu(await toEventBase(event.event));
131128
await this.processNotificationStage(event);
132129

@@ -248,23 +245,6 @@ export class StagingAreaService {
248245
return addedMissing;
249246
}
250247

251-
private async processAuthorizationStage(event: EventStagingStore) {
252-
this.logger.debug(`Authorizing event ${event._id}`);
253-
const authEvents = await this.eventService.getAuthEventIds(
254-
event.event.type,
255-
{ roomId: event.event.room_id, senderId: event.event.sender },
256-
);
257-
258-
const isAuthorized = await this.eventAuthService.authorizeEvent(
259-
event.event,
260-
authEvents.map((e) => e.event),
261-
);
262-
263-
if (!isAuthorized) {
264-
throw new Error('event authorization failed');
265-
}
266-
}
267-
268248
private async processNotificationStage(event: EventStagingStore) {
269249
this.logger.debug(`Notifying clients about event ${event._id}`);
270250

0 commit comments

Comments
 (0)