Completely getting rid of "userid"
Previously, userid was generated by the "/login" route and passed along. This commit completely removes the uuid "userid" (and disables the LoginController too and any Jwt check). "userid" is replaced by the "socket id" of the connection. So a user is now identified using a socket id, which is unique for a given connection.
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import {Socket} from "socket.io";
|
||||
import {PointInterface} from "./PointInterface";
|
||||
import {Identificable} from "./Identificable";
|
||||
|
||||
export interface ExSocketInterface extends Socket {
|
||||
export interface ExSocketInterface extends Socket, Identificable {
|
||||
token: any;
|
||||
roomId: string;
|
||||
webRtcRoomId: string;
|
||||
userId: string;
|
||||
//userId: string;
|
||||
name: string;
|
||||
character: string;
|
||||
position: PointInterface;
|
||||
|
||||
@@ -22,7 +22,7 @@ let RefreshUserPositionFunction = function(rooms : ExtRooms, Io: socketIO.Server
|
||||
continue;
|
||||
}
|
||||
let data = {
|
||||
userId: socket.userId,
|
||||
userId: socket.id,
|
||||
roomId: socket.roomId,
|
||||
position: socket.position,
|
||||
name: socket.name,
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
export interface Identificable {
|
||||
id: string;
|
||||
}
|
||||
@@ -16,6 +16,7 @@ export class Message {
|
||||
}
|
||||
|
||||
toJson() {
|
||||
|
||||
return {
|
||||
userId: this.userId,
|
||||
roomId: this.roomId,
|
||||
|
||||
Reference in New Issue
Block a user