Unregister & Unsubscribe vom SSE für Keys eingebaut
This commit is contained in:
@@ -2,7 +2,7 @@ import { Controller, Get, Param, Query, Req, Sse, UnauthorizedException, UseGuar
|
||||
import { AuthenticatedRequest } from 'src/model/interface/authenticated-request.interface';
|
||||
import { SseTicketService } from './sse-ticket.service';
|
||||
import { AuthGuard } from 'src/core/guards/auth.guard';
|
||||
import { Observable } from 'rxjs';
|
||||
import { finalize, Observable } from 'rxjs';
|
||||
import { SseService } from './sse.service';
|
||||
|
||||
@Controller('sse')
|
||||
@@ -23,6 +23,10 @@ export class SseController {
|
||||
if (!userId) throw new UnauthorizedException('Invalid/expired ticket');
|
||||
|
||||
|
||||
return this.sseService.register(userId);
|
||||
return this.sseService.register(userId).pipe(
|
||||
finalize(() => {
|
||||
this.sseService.unregister(userId)
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user