i’m pretty much stuck with setting a default JWT authorization header.
The problem is that ionic storage returns a promise and i can’t fin out the right way to use it.
I’m surprised that even compiled, because merge() isn’t returning what it says it is supposed to. You have two options: either retrieve the token earlier (such as at constructor time) and somehow refrain from ever calling merge() before that is done (which is tricky), or change merge() to return a Promise<RequestOptions>. To avoid execution context problems, never type the word ‘function’ inside of one: always use arrow functions or lambdas.
" or change merge() to return a Promise<RequestOptions>" - tried, thats not possible => Class 'MyRequestOptions' incorrectly extends base class 'BaseRequestOptions'. Types of property 'merge' are incompatible. Type '(options?: RequestOptionsArgs) => Promise<RequestOptions>' is not assignable to type '(options?: RequestOptionsArgs) => RequestOptions'. Type 'Promise<RequestOptions>' is not assignable to type 'RequestOptions'. Property 'method' is missing in type 'Promise<RequestOptions>'.