I'm currently doing security on my routes in ngOnInit, if it has on the localStorage the token key, then it stays on the Home route (My root route is the home). Otherwise, it redirects to the login screen. The problem is that it has a delay, the Home screen is displayed for a few milliseconds and then switches to the Login screen.
I have tried the / ngOnInit constructor and appcomponen.ts as soon as the platform is ready, but in this way I still have a blink on the screen.
Does anyone have a solution for this?