One of our app's requirements is that recording features should be locked away and inaccessible until a user is authenticated. This provides us with the ability to have a user base and potentially introduce paid features down the road if we so desire.
Angular provides the ability to insert guards on our routes, which would only activate under certain conditions. This is exactly what we need to implement this feature requirement, since we have isolated the '/record' route to lazily load RecorderModule, which will contain all the recording features. We want to only allow access to that '/record' route if the user is authenticated.
Let's create app/guards/auth-guard.service.ts in a new folder for scalability, since we could grow and create other guards as necessary here:
import { Injectable } from '@angular...