change(ui) - assist agentToken

This commit is contained in:
Shekar Siri 2022-09-28 18:08:58 +05:30
parent 56ed06ed17
commit f23d54a9cd
3 changed files with 7 additions and 3 deletions

View file

@ -109,7 +109,7 @@ export default class MessageDistributor extends StatedScreen {
if (live) {
initListsDepr({})
this.assistManager.connect();
this.assistManager.connect(this.session.agentToken);
} else {
this.activityManager = new ActivityManager(this.session.duration.milliseconds);
/* == REFACTOR_ME == */

View file

@ -119,7 +119,7 @@ export default class AssistManager {
}
private socket: Socket | null = null
connect() {
connect(agentToken: string) {
const jmr = new JSONRawMessageReader()
const reader = new MStreamReader(jmr)
let waitingForMessages = true
@ -146,6 +146,9 @@ export default class AssistManager {
// @ts-ignore WTF, socket.io ???
const socket: Socket = this.socket = io(urlObject.origin, {
path: '/ws-assist/socket',
auth: {
token: agentToken
},
query: {
peerId: this.peerID,
identity: "agent",

View file

@ -81,7 +81,8 @@ export default Record({
revId: '',
userSessionsCount: 0,
agentIds: [],
isCallActive: false
isCallActive: false,
agentToken: ''
}, {
fromJS:({
startTs=0,