Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
import { redirectUnauthorizedTo, canActivate } from '@angular/fire/auth-guard';
const redirectToLogin = redirectUnauthorizedTo(['login']);
const routes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{
path: 'home',
loadChildren: () =>
import('./home/home.module').then(m => m.HomePageModule),
...canActivate(redirectToLogin)
},
{ path: 'login', loadChildren: './pages/login/login.module#LoginPageModule' },
{
path: 'signup',
loadChildren: './pages/signup/signup.module#SignupPageModule'
},
{
path: 'reset-password',