diff --git a/.env_sample b/.env_sample deleted file mode 100644 index d615c83..0000000 --- a/.env_sample +++ /dev/null @@ -1,26 +0,0 @@ -POSTGRES_HOST=postgres -POSTGRES_PORT=5432 -POSTGRES_USER=postgres_usr -POSTGRES_PASSWORD=postgres_pw -POSTGRES_DB=transcendence - -PGADMIN_DEFAULT_EMAIL=admin@pg.com -PGADMIN_DEFAULT_PASSWORD=admin - -MAIL_USER=vaganiwast@gmail.com -MAIL_PASSWORD= - -FRONT_FPS=144 - -HOST=localhost -VITE_HOST=localhost -FRONT_PORT=80 -BACK_PORT=3001 -HASH_SALT=10 - -JWT_SECRET=test -JWT_EXPIRATION_TIME=900 - -FT_OAUTH_CLIENT_ID= -FT_OAUTH_CLIENT_SECRET= -FT_OAUTH_CALLBACK_URL=http://$HOST:$BACK_PORT/log/inReturn diff --git a/Makefile b/Makefile index e4d9e0b..52915d4 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ USER = gavaniwast all: clean dev dev: - NODE_ENV="development" docker-compose up --build + NODE_ENV="development" docker compose up --build check: NODE_ENV="check" docker-compose run back --build diff --git a/back/volume/src/auth/mails/confirm.hbs b/back/volume/src/auth/mails/confirm.hbs index fbcb9c5..461a90c 100644 --- a/back/volume/src/auth/mails/confirm.hbs +++ b/back/volume/src/auth/mails/confirm.hbs @@ -8,7 +8,7 @@

Hello {{username}}!

Once you clicked on the next verify button, you will have access to the app

-
+
diff --git a/back/volume/src/chat/chat.gateway.ts b/back/volume/src/chat/chat.gateway.ts index 5daa9e8..117dc71 100644 --- a/back/volume/src/chat/chat.gateway.ts +++ b/back/volume/src/chat/chat.gateway.ts @@ -109,6 +109,10 @@ export class ChatGateway implements OnGatewayConnection, OnGatewayDisconnect { @SubscribeMessage('addMessage') async onAddMessage(socket: Socket, message: CreateMessageDto): Promise { const channel = await this.chatService.getChannel(message.ChannelId); + if (channel == null) { + this.server.to(socket.id).emit('kicked') + throw new WsException('Channel has been removed by owner'); + } if (await this.chatService.isMuted(channel.id, message.UserId)) { throw new WsException('You are muted'); } @@ -136,7 +140,6 @@ export class ChatGateway implements OnGatewayConnection, OnGatewayDisconnect { })) as ConnectedUser if (connect) { console.log(`kicking ${user.username} from ${channel.name} with socket ${connect.socket}`) - // this.server.sockets.sockets.get(connect.socket)?.emit('kicked'); this.server.to(connect.socket).emit('kicked') } } diff --git a/list b/list new file mode 100644 index 0000000..09cd609 --- /dev/null +++ b/list @@ -0,0 +1,2 @@ +- manage users on deleting channel +- delete \ No newline at end of file