improvements

This commit is contained in:
tiago.kayaya
2021-01-13 10:02:30 +01:00
parent 6596941cdd
commit 586651e95e
18 changed files with 591 additions and 205 deletions
+8 -17
View File
@@ -47,37 +47,28 @@ export class AuthService {
//Login to rocketChat server
loginChat(postData: any):Observable<any> {
const res = this.httpService.post('login', postData);
const res2 = res.subscribe(res=>{
this.storageService.store(res);
});
return res;
return this.httpService.post('login', postData);
}
//Get user data from RocketChat
//Get user data from RocketChat | global object
getUserData(){
const res = this.storageService.get('user');
console.log(res);
/* this.storageService.get(AuthConnstants.AUTH).then(res=>{
this.storageService.get(AuthConnstants.AUTH).then(res=>{
this.userData$.next(res);
}) */
});
}
/* getProfile(){
getProfile(){
this.storageService.get(AuthConnstants.PROFILE).then(res=>{
return res;
});
} */
}
logoutChat(){
//this.storageService.clear();
/* this.storageService.removeStorageItem(AuthConnstants.AUTH).then(res =>{
this.storageService.removeStorageItem(AuthConnstants.AUTH).then(res =>{
this.userData$.next('');
this.router.navigate(['']);
}) */
})
}
}