Hi Manfred,

- Providing metadata for components to state that they can be accessed by 
> unauthenticated users, something like @Auth({anonymous:true})
> - Using event to prevent unauthenticated users to access components 
> without this directive or with @Auth({anonymous:false})
>
Well, the state of a user should live in a service. You can check that 
state easily in the components using the canActivate hook. And indeed, 
writing a small decorator that does that is a good way to handle it.
That decorator can even wrap in a existing canActivate. As ng2 has no clue 
on how you auth works(that's a good thing!) there can not be a generic 
solution. 
Alternatively, You can create a split in the 'top' of your app, where you 
decide if an user is authed or not, and put everything that needs to know 
in it's own 'branch'

Regards
Sander 

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to