I wan't to allow only logged in users to access a certain site. What's the proper way of checking if a user is logged in on load?
The code below is my first try, don't really know if it works though. Of course I already wrote db rules, now I want to complete the behavior visually for the user.
this.af.auth.subscribe(auth => {
if (auth) {
//route to other view
} else {
//do whatever
}
});