(Solved) Bad getting data from local storage

Because of timing.

Retrieving from storage is an asynchronous operation. I assume you are surrounding the snippet from your http request with new Promise. Don’t do that.

This snippet:

 let token;
 this.storage.get('token').then((val) => {
   token =  'Bearer '+val;
   console.log(token);
 });

…is totally broken. You have no idea when token has what value. Read this post and rewrite this section to be a type 3 function, returning the Promise you get from storage. The code that actually does anything with token must live in a then block when it resolves.