serhiisol / ngx-auth

Angular 16+ Authentication Module
MIT License
234 stars 47 forks source link

same useValue #36

Closed meherett closed 5 years ago

meherett commented 5 years ago
{ provide: PROTECTED_FALLBACK_PAGE_URI, useValue: '/' },
 { provide: PUBLIC_FALLBACK_PAGE_URI, useValue: '/login' },
{
    path: '',
    canActivate: [ ProtectedGuard ],
    loadChildren: './components/protected/protected.module#ProtectedModule'
  },
  {
    path: 'login',
    canActivate: [ PublicGuard ],
    loadChildren: './components/public/public.module#PublicModule'
  },

to

{ provide: PROTECTED_FALLBACK_PAGE_URI, useValue: '/' },
 { provide: PUBLIC_FALLBACK_PAGE_URI, useValue: '/' },

{
    path: '',
    canActivate: [ ProtectedGuard ],
    loadChildren: './components/protected/protected.module#ProtectedModule'
  },
  {
    path: '',
    canActivate: [ PublicGuard ],
    loadChildren: './components/public/public.module#PublicModule'
  },

it is not work?

serhiisol commented 5 years ago

I'm not really sure what you want to achieve here. Just remove guards here and add them only for the necessary components, like above, for login page

serhiisol commented 5 years ago

Feel free to comment this issue, if you have more details :)