1
I’m creating an Interceptor to send the token along with the requests for the Api.
I use @ionic/storage
to store my user information. However, when I try to get the token in the constructor to store in a variable (e.g., private token: string), my Interceptor cannot get that value even if the token exists. I believe this happens because the Intercept runs before the this.storage.get function finishes.
How can I fix this?
I’ve tried to set the function this.storage.get
inside the Intercept, but the return error:
"Type 'Promise>>' is not Assignable to type 'Observable>'. Property '_isScalar' is Missing in type 'Promise>>'."
Look at the code:
I appreciate the help.