The problem here is that performTokenRequest() is not returning a Promise, due to which the tokens are received and stored asynchronously by the time other components of my application start loading. I need this piece of code to run synchronously so on application launch itself I am able to trigger authentication and without receiving the tokens I am not able to load the application.
[REQUIRED] Actual Behavior
Here, the control comes out of the tokenRequest method while other pieces of code start to be executed.
[REQUIRED] Describe expected behavior
The piece of code inside then() should be resolved immediately in a synchronous fashion since performTokenRequest() is returning a promise.
Describe the problem
The problem here is that performTokenRequest() is not returning a Promise, due to which the tokens are received and stored asynchronously by the time other components of my application start loading. I need this piece of code to run synchronously so on application launch itself I am able to trigger authentication and without receiving the tokens I am not able to load the application.
[REQUIRED] Actual Behavior
Here, the control comes out of the tokenRequest method while other pieces of code start to be executed.
[REQUIRED] Steps to reproduce the behavior
In my constructor I have this piece of code:
Method call:
[REQUIRED] Environment