This commit is contained in:
tiago.kayaya
2020-12-16 16:17:22 +01:00
parent 93561b5909
commit bc7f256ce6
2 changed files with 1 additions and 2 deletions
-1
View File
@@ -21,7 +21,6 @@ export class ChatService {
private authService: AuthService, private authService: AuthService,
private storageService:StorageService,) { private storageService:StorageService,) {
this.headers = new HttpHeaders(); this.headers = new HttpHeaders();
this.storageService.get()
this.authService.userData$.subscribe((res:any)=>{ this.authService.userData$.subscribe((res:any)=>{
this.headers = this.headers.set('X-User-Id', res.userId); this.headers = this.headers.set('X-User-Id', res.userId);
this.headers = this.headers.set('X-Auth-Token', res.authToken); this.headers = this.headers.set('X-Auth-Token', res.authToken);
+1 -1
View File
@@ -13,7 +13,7 @@ import { Storage } from '@ionic/storage';
} }
// Get the value // Get the value
async get(user: any) { async get() {
const ret = await this.storage.get('user').then(res=>{ const ret = await this.storage.get('user').then(res=>{
return JSON.parse(unescape(atob(ret.value))); return JSON.parse(unescape(atob(ret.value)));
}); });