Hi all –
I’m having an execution flow problem with an Ionic 2 app that I can’t quite solve. I’m trying to implement Auth0 in an existing app. All was well with the Auth0 starter app (01-login), including retrieving an auth token from storage in the auth provider constructor before the app.component.ts called a method to validate authentication of the token.
However, in my existing app, the app.component.ts call to authenticate executes before the auth service constructor has returned the token from storage. Attached is a debug screenshot, and below is a link to the Auth0 forum where I have posted the code. I thought perhaps this might be more of an Ionic question – really about execution flow and why it works in the sample app and not in my larger (though not particularly complex) app.
Any ideas on where to look? I’ve combed through the code and I swear it is identical to the sample app from what I can see. I’ve checked all of the module declarations and injections, etc. I think. But obviously I’m missing something.
Link to Auth0 forum (with code):