This commit is contained in:
Peter Maquiran
2022-05-06 15:56:18 +01:00
18 changed files with 102 additions and 41 deletions
+11 -5
View File
@@ -61,9 +61,15 @@ export class AuthService {
}
if (localStorage.getItem("userChat") != null) {
this.ValidatedUserChat = {
data: JSON.parse(localStorage.getItem('userChat'))
};
if(!this.ValidatedUserChat.hasOwnProperty('data')) {
this.ValidatedUserChat = {
data: JSON.parse(localStorage.getItem('userChat'))
};
} else {
this.ValidatedUserChat = JSON.parse(localStorage.getItem('userChat'))
}
}
}
@@ -149,8 +155,8 @@ export class AuthService {
async loginChat(responseChat = this.ValidatedUserChat) {
this.ValidatedUserChat = responseChat;
localStorage.setItem('userChat', JSON.stringify(responseChat));
this.storageService.store(AuthConnstants.AUTH, responseChat);
localStorage.setItem('userChat', JSON.stringify(responseChat));
this.storageService.store(AuthConnstants.AUTH, responseChat);
/* const expirationMinutes = 30;
let date = new Date().getTime();