Situation: I'm busy developing an online course where the user has to go through a series of pages in order, but I want to keep them from navigating to other pages. If they attempt to, the current page just loads again.
My idea: I created a public boolean array that keeps track of the users' progress (example below):
progress: [boolean, boolean, boolean] = [true, false, false];
End of Page 1:
progress[0] = false;
progress[1] = true;
End of Page 2:
progress[1] = false;
progress[2] = true;
My question is: How can I use the auth guard, canLoad, to prohibit the user from accessing any other pages based on the progress array?
I have a lot of pages and would love to perform the check using one Auth Gaurd and not create a guard for every page.