I am currently trying to incorporate authentication into an Angular application using Okta. I have carefully followed the step-by-step instructions provided in the documentation at this link: . However, I am encountering an error when attempting to start the server. Can someone please assist me with this issue?
export class AppComponent {
title = 'okta';
isAuthenticated: boolean;
constructor(public oktaAuth: OktaAuthService, public router: Router) {
// Subscribe to authentication state changes
this.oktaAuth.$authenticationState.subscribe(
(isAuthenticated: boolean) => this.isAuthenticated = isAuthenticated
);
}
async ngOnInit() {
// Get the authentication state for immediate use
this.isAuthenticated = await this.oktaAuth.isAuthenticated();
}
! console error