Refresh token done

This commit is contained in:
Eudes Inácio
2022-06-10 09:42:41 +01:00
parent 1bdf3daf12
commit 4275d71a43
16 changed files with 19 additions and 93 deletions
+3 -7
View File
@@ -133,7 +133,7 @@ export class ChatPage implements OnInit {
ngOnInit() {
/* let data = {
/* let data = {
status: "success",
data: {
userId: "CqYSKR5hrAumZihs7",
@@ -142,6 +142,8 @@ export class ChatPage implements OnInit {
}
SessionStore.user.ChatData = data
SessionStore.save() */
console.log(SessionStore.user.ChatData.data.authToken)
this.chatService.refreshtoken();
this.segment = "Contactos";
@@ -517,12 +519,6 @@ export class ChatPage implements OnInit {
//
}*/
},(error: HttpErrorResponse) => {
if(error.status === 401){
this.chatService.refreshtoken()
//this.getChatMembers();
}
});
}
@@ -29,6 +29,7 @@ export class EditGroupPage implements OnInit {
}
ngOnInit() {
this.chatService.refreshtoken();
this.getRoomInfo();
}
@@ -37,11 +38,6 @@ export class EditGroupPage implements OnInit {
this.room = room['room'];
this.groupName = this.room.name.split('-').join(' ');
},(error: HttpErrorResponse) => {
if(error.status === 401) {
this.chatService.refreshtoken();
this.getRoomInfo()
}
});
}
@@ -56,6 +56,7 @@ export class GroupContactsPage implements OnInit {
}
ngOnInit() {
this.chatService.refreshtoken();
this.loadUsers();
this.getMembers();
@@ -85,12 +86,6 @@ export class GroupContactsPage implements OnInit {
this.showLoader = false;
},(error: HttpErrorResponse) => {
if(error.status === 401){
this.chatService.refreshtoken()
this.loadUsers();
}
});
}
@@ -133,6 +133,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
ngOnInit() {
this.chatService.refreshtoken();
this.loggedUser = this.loggedUserChat;
this.getRoomInfo();
@@ -381,12 +382,6 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.allUsers = res['users'].filter(data => data.username != SessionStore.user.UserName);
},(error: HttpErrorResponse) => {
if(error.status === 401){
this.chatService.refreshtoken()
this.getChatMembers();
}
});
}
@@ -43,6 +43,7 @@ export class ContactsPage implements OnInit {
}
ngOnInit() {
this.chatService.refreshtoken();
this.loadUsers();
}
@@ -67,12 +68,6 @@ export class ContactsPage implements OnInit {
return 0;
});
this.showLoader = false;
},(error: HttpErrorResponse) => {
if(error.status === 401){
this.chatService.refreshtoken()
this.loadUsers();
}
});
}
+1 -6
View File
@@ -157,6 +157,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
ngOnInit() {
this.chatService.refreshtoken();
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
})
@@ -520,12 +521,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.members = res['members'];
this.dmUsers = res['members'].filter(data => data.username != this.sessionStore.user.UserName)
this.showLoader = false;
},(error: HttpErrorResponse) => {
if(error.status === 401){
this.chatService.refreshtoken()
this.getChatMembers();
}
});
}
@@ -43,6 +43,7 @@ export class NewGroupPage implements OnInit {
}
ngOnInit() {
this.chatService.refreshtoken();
console.log(this.documents)
}