Event Subscribers
Another are where AuthGuard can be extended is through its internal messaging layer. Some parts of the system publish events to internal channels through a message bus, and that message bus delivers the events to listeners.
Implementing Subscribers#
To add your own subscriber you need to implement the MessageSubscriber interface and specify which channels you need that subscriber to listen to using @Channel annotation.
For example, here is a subscriber which does nothing but log any message it received.
Channels#
The current list of channels is quite limited, and will be extended in the future. The currently supported channels are:
accounts: for all changes related to accountsapps: for all changes related to applicationauth: for any authentication attemptotp: for any generated OTPspasswordless: for any generated passwordless tokens
You may choose to enable only some of these channels, in which case all events pushed to them will be discarded.