serhiisol / ngx-auth

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

PublicGuard and ProtectedGuard #18

Closed rafaelvalerini closed 6 years ago

rafaelvalerini commented 6 years ago

Hi,

Is it possible to use PublicGuard and ProtectedGuard for the same url? For even after logging in, the user can also access the public screens and this code not work:

{
        path:'user',
        canActivate: [ PublicGuard, ProtectedGuard ],
        component: LoginComponent
}

When trying to access the url user, nothing happens to the user logged.

I need a same screen can be accessed with the logged in user and also be accessed when the user is not yet logged in.

serhiisol commented 6 years ago

Hi @rafaelvalerini. What's the point of doing that ? If you want to give access to the page for all the users, just remove those guards completely :)