I’m using this article to build an Angular app:
I have a navigation menu using routing and I need one on the routed components to have access to the logged in users info (email, name, etc). I tried making a service, but no luck.
I’ve put the same code that is in my app.component.ts in my desired component:
showLogin() {
this.oktaSignIn.renderEl({el: '#okta-login-container'}, (response) => {
if (response.status === 'SUCCESS') {
this.user = response.claims.email;
this.oktaSignIn.remove();
this.changeDetectorRef.detectChanges();
}
});
}
but user is always undefined. Any ideas?