Fix login

This commit is contained in:
Peter Maquiran
2022-01-10 10:22:17 +01:00
parent 053e5a2370
commit 402e1f8a95
2 changed files with 20 additions and 9 deletions
+3 -1
View File
@@ -100,9 +100,11 @@ export class HomePage implements OnInit {
this.RocketChatClientService.connect(()=>{ this.RocketChatClientService.connect(()=>{
this.RocketChatClientService.login({ this.RocketChatClientService.login({
username: 'paulo.pinto@gabinetedigital.local', username: 'paulo.pinto',
email: 'paulo.pinto@gabinetedigital.local',
password: 'tabteste@006' password: 'tabteste@006'
}) })
}) })
// this.RocketChatClientService.send() // this.RocketChatClientService.send()
@@ -34,6 +34,10 @@ class _RocketChatClientService {
if(this.hasPing == false) { if(this.hasPing == false) {
// first ping // first ping
firstPingFunx() firstPingFunx()
setTimeout(()=>{
this.getRooms()
}, 5000)
this.hasPing = true this.hasPing = true
} }
} }
@@ -51,11 +55,8 @@ class _RocketChatClientService {
id: requestId, id: requestId,
params: [ params: [
{ {
"user": { "username": user.username }, user: { username: user.username },
"password": { password: user.password
"digest": user.password,
"algorithm":"sha-256"
}
} }
] ]
} }
@@ -85,13 +86,21 @@ class _RocketChatClientService {
return requestId; return requestId;
} }
receive() {} subtribe() {}
joinRoom(){} joinRoom(){}
deleteMessage() {} deleteMessage() {}
createRoom() {} createRoom() {}
getRooms() { getRooms() {
const requestId = uuidv4()
const request = {
"msg": "method",
"method": "rooms/get",
"id": requestId,
"params": [ { "$date": 1480377601 } ]
}
this.ws.send(request, requestId)
} }
@@ -116,10 +125,10 @@ class _RocketChatClientService {
// socket class ================================================================== // socket class ==================================================================
private socket!: WebSocket; private socket!: WebSocket;
private wsUrl = '' private wsUrl = ''
wsMsgQueue : msgQueue[] = [] private wsMsgQueue : msgQueue[] = []
private wsCallbacks: {[key: string]: wsCallbacksParams} = {} private wsCallbacks: {[key: string]: wsCallbacksParams} = {}
ws = { private ws = {
connected: false, connected: false,
registerCallback:(params: wsCallbacksParams) =>{ registerCallback:(params: wsCallbacksParams) =>{