This commit is contained in:
Peter Maquiran
2022-07-22 15:52:10 +01:00
parent 5533116e9d
commit 3a6b23b5f5
4 changed files with 29 additions and 18 deletions
+22 -16
View File
@@ -360,24 +360,30 @@ export class ChatService {
}
refreshtoken() {
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
let options = {
headers: this.headers
};
return this.http.get(environment.apiURL + 'UserAuthentication/RegenereChatToken', options).subscribe(async res => {
let data = {
status: res['status'],
data: {
userId: res['data'].userId,
authToken: res['data'].authToken
if(this.headers) {
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
let options = {
headers: this.headers
};
return this.http.get(environment.apiURL + 'UserAuthentication/RegenereChatToken', options).subscribe(async res => {
let data = {
status: res['status'],
data: {
userId: res['data'].userId,
authToken: res['data'].authToken
}
}
}
SessionStore.user.ChatData = data
SessionStore.save()
SessionStore.user.ChatData = data
SessionStore.save()
this.setheader()
// console.log(res)
// console.log(SessionStore.user.ChatData)
});
} else {
this.setheader()
// console.log(res)
// console.log(SessionStore.user.ChatData)
});
}
}
}