From 8d6a7366a41a47166819f9a5e770cc59408ed5c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bence=20Nagygy=C3=B6rgy?= Date: Mon, 18 Sep 2023 15:00:45 +0200 Subject: [PATCH] fix(crux): add return type back --- web/crux/src/app/config.bundle/config.bundle.ws.gateway.ts | 2 +- web/crux/src/app/deploy/deploy.ws.gateway.ts | 2 +- web/crux/src/app/token/jwt-auth.guard.ts | 4 ++-- web/crux/src/app/version/version.ws.gateway.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/crux/src/app/config.bundle/config.bundle.ws.gateway.ts b/web/crux/src/app/config.bundle/config.bundle.ws.gateway.ts index 1f69bca17d..f7da49363d 100644 --- a/web/crux/src/app/config.bundle/config.bundle.ws.gateway.ts +++ b/web/crux/src/app/config.bundle/config.bundle.ws.gateway.ts @@ -87,7 +87,7 @@ export default class ConfigBundleWebSocketGateway { @SocketClient() client: WsClient, @ConfigBundleId() configBundleId: string, @SocketSubscription() subscription: WsSubscription, - ) { + ): Promise { const data = await this.service.onEditorLeft(configBundleId, client.token) const message: WsMessage = { type: WS_TYPE_EDITOR_LEFT, diff --git a/web/crux/src/app/deploy/deploy.ws.gateway.ts b/web/crux/src/app/deploy/deploy.ws.gateway.ts index c18210a4b0..9f17750ccd 100644 --- a/web/crux/src/app/deploy/deploy.ws.gateway.ts +++ b/web/crux/src/app/deploy/deploy.ws.gateway.ts @@ -137,7 +137,7 @@ export default class DeployWebSocketGateway { @SocketClient() client: WsClient, @DeploymentId() deploymentId: string, @SocketSubscription() subscription: WsSubscription, - ) { + ): Promise { const data = await this.service.onEditorLeft(deploymentId, client.token) const message: WsMessage = { type: WS_TYPE_EDITOR_LEFT, diff --git a/web/crux/src/app/token/jwt-auth.guard.ts b/web/crux/src/app/token/jwt-auth.guard.ts index aed4f58c85..f11418651c 100644 --- a/web/crux/src/app/token/jwt-auth.guard.ts +++ b/web/crux/src/app/token/jwt-auth.guard.ts @@ -39,7 +39,7 @@ export default class JwtAuthGuard extends AuthGuard('jwt') { return await this.canActivateHttp(context, context.switchToHttp().getRequest(), strategy) } if (type === 'ws') { - return await this.canActivateWs(context) + return this.canActivateWs(context) } this.logger.error(`Invalid context ${type}`) @@ -107,7 +107,7 @@ export default class JwtAuthGuard extends AuthGuard('jwt') { req.headers.authorization = `Bearer ${token}` } - private async canActivateWs(context: ExecutionContext): Promise { + private canActivateWs(context: ExecutionContext): boolean { const client: WsClient = context.switchToWs().getClient() const message = this.reflector.get('message', context.getHandler()) if (client.disconnecting) { diff --git a/web/crux/src/app/version/version.ws.gateway.ts b/web/crux/src/app/version/version.ws.gateway.ts index 04d2f0619e..d4abaaf3c9 100644 --- a/web/crux/src/app/version/version.ws.gateway.ts +++ b/web/crux/src/app/version/version.ws.gateway.ts @@ -101,7 +101,7 @@ export default class VersionWebSocketGateway { @SocketClient() client: WsClient, @VersionId() versionId: string, @SocketSubscription() subscription: WsSubscription, - ) { + ): Promise { const data = await this.service.onEditorLeft(versionId, client.token) const message: WsMessage = { type: WS_TYPE_EDITOR_LEFT,