I have an angular app. There I have a route ('home') protected by a routeGuard. I locally save the username and hash(password) if the user has signed in once and on app load I fetch them and initiate the signin process, which is a server call and takes some time. Now if I reopen the app by hitting the home route (https://localhost:4200/home), during the app load the signin process is initiated but the router guard triggers and returns false (because no account data is present since signin is not complete). Even after a successful signin the application remains in a dangling state. I wanted to know what is the best approach in this case? SHould I just navigate to the "home" route manually once the server call is finished? Is there a way for the router to revisit its last first route? or get a handle on the guard to trigger the last route it blocked?
Asked
Active
Viewed 25 times