I use the angular-oauth2-oidc project for OpenId in an Angular project. For some reason, I want to disable the authentication for some routes. I initialize the code flow in the main component and bootstrap it to the bootstrap section of the main module.
If you are going to exclude some routes, it's better to change the bootstrapped component and initialize the code flow in the authorized component. create a main component and two other components for authorized and non-authorized URLs then bootstrap the main component in the main module and based on user routing load one of the created components.