Guards
Guards implemented on top of pipelines have a single responsibility to check if a method can be activated.
guard pipeline must implement the IGuard
interface.
if the guard decorate a class it will run on all class methods.
#
Usagenow lets use out authGuard
#
Custom Erroryou can also throw your own custom error
#
Roles Guard examplewe assume we a user context on our request
now we check the controller