: change payload jwt, add _id

This commit is contained in:
StarAppeal
2024-03-07 10:17:52 +01:00
parent 8a494ab19b
commit 5c2c54fb8e
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
export interface DecodedToken {
uuid: string;
name: string;
_id: string;
}
+2 -2
View File
@@ -45,11 +45,11 @@ export class ExtendedWebSocketServer {
});
}
public sendMessageToUser(userName: string, message: string) {
public sendMessageToUser(_id: string, message: string) {
this.wss.clients.forEach(
(client: WebSocket & { payload?: DecodedToken }) => {
if (
client.payload?.name === userName &&
client.payload?._id === _id &&
client.readyState === WebSocket.OPEN
) {
client.send(message, { binary: false });