roles into wsscnx from sess
This commit is contained in:
+7
-1
@@ -30,7 +30,7 @@ export class wssServer {
|
||||
|
||||
newWSSConnexion(socket, req) {
|
||||
var uuid = crypto.randomUUID();
|
||||
if(socket.session && socket.session.authenticated && socket.session.userInfos && socket.session.userInfos.username){
|
||||
if(socket.session && socket.session.authenticated && socket.session.userInfos && socket.session.userInfos.identity && socket.session.userInfos.identity.username){
|
||||
var wssCnx = new WssConnexion({
|
||||
socket: socket,
|
||||
req, req,
|
||||
@@ -40,8 +40,14 @@ export class wssServer {
|
||||
config: this.wssGatewayConfig,
|
||||
rediscnx: this.REDIScnx,
|
||||
accessRights: this.accessRights,
|
||||
userId: socket.session.userInfos.identity.uuid,
|
||||
roles: socket.session.userInfos.roles,
|
||||
});
|
||||
this.AllWssConnections[uuid] = wssCnx;
|
||||
if(!(wssCnx.userId in this.Users2uuids)) this.Users2uuids[wssCnx.userId] = new Set();
|
||||
this.Users2uuids[wssCnx.userId].add(uuid);
|
||||
this.OnlineUsers.add(wssCnx.userId);
|
||||
this.REDIScnx.wssConnections[uuid] = wssCnx;
|
||||
this.postLoginActions(wssCnx)
|
||||
} else socket.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user